flowcollab 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/pull.mjs +13 -9
- package/package.json +1 -1
package/bin/pull.mjs
CHANGED
|
@@ -420,15 +420,19 @@ async function main() {
|
|
|
420
420
|
process.stderr.write(`flow-pull: --sync-md failed: ${e.message}\n`);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
// Write project_id to global config (atomic, 0o600-enforced — see saveGlobalConfig)
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
423
|
+
// Write project_id to global config (atomic, 0o600-enforced — see saveGlobalConfig).
|
|
424
|
+
// CLI-1 (audit): only SEED it when none is resolved yet — don't clobber a project the user already
|
|
425
|
+
// selected (the old code overwrote it with 'main'/the oldest project on every --sync-md).
|
|
426
|
+
if (!RESOLVED_PROJECT) {
|
|
427
|
+
try {
|
|
428
|
+
const { projects } = await flowFetch('/api/flow/projects');
|
|
429
|
+
const defaultProject = projects?.find(p => p.slug === 'main') || projects?.[0];
|
|
430
|
+
if (defaultProject?.id) {
|
|
431
|
+
saveGlobalConfig({ projectId: defaultProject.id });
|
|
432
|
+
process.stdout.write(` project_id → ~/.flow/config.json (project: ${defaultProject.slug})\n`);
|
|
433
|
+
}
|
|
434
|
+
} catch { /* non-fatal */ }
|
|
435
|
+
}
|
|
432
436
|
}
|
|
433
437
|
}
|
|
434
438
|
|