oreshnik-cli 0.1.1 → 0.1.2

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/dist/cli.js CHANGED
@@ -364,8 +364,16 @@ async function initCommand(options) {
364
364
  mkdirSync(vaultDir, { recursive: true });
365
365
  mkdirSync(handoffsDir, { recursive: true });
366
366
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
367
- writeFileSync(join(varDir, "task-board.json"), JSON.stringify(taskBoard, null, 2) + "\n", "utf8");
368
- writeFileSync(join(varDir, ".mother-version.json"), JSON.stringify({ version: 1, current: mainBranch, branches: [] }, null, 2) + "\n", "utf8");
367
+ const taskBoardPath = join(varDir, "task-board.json");
368
+ if (existsSync(taskBoardPath)) {
369
+ log("WARN", "task-board.json already exists \u2014 not overwriting. Use --force to overwrite all files.");
370
+ } else {
371
+ writeFileSync(taskBoardPath, JSON.stringify(taskBoard, null, 2) + "\n", "utf8");
372
+ }
373
+ const motherPath = join(varDir, ".mother-version.json");
374
+ if (!existsSync(motherPath) || options.force) {
375
+ writeFileSync(motherPath, JSON.stringify({ version: 1, current: mainBranch, branches: [] }, null, 2) + "\n", "utf8");
376
+ }
369
377
  writeFileSync(join(handoffsDir, "zone-map.json"), JSON.stringify(zoneMap, null, 2) + "\n", "utf8");
370
378
  writeFileSync(join(vaultDir, config.vault.centralDoc), generateCentralDoc(projectNameFinal), "utf8");
371
379
  const collabDir = join(vaultDir, "COLABORADORES");