chiefwiggum 1.3.0 → 1.3.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.cjs +27 -20
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -50,7 +50,7 @@ async function checkForUpdates(currentVersion) {
|
|
|
50
50
|
}).trim();
|
|
51
51
|
if (result && result !== currentVersion) {
|
|
52
52
|
console.log(import_picocolors.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
|
|
53
|
-
console.log(import_picocolors.default.cyan(" Run:
|
|
53
|
+
console.log(import_picocolors.default.cyan(" Run: npm install -g chiefwiggum@latest"));
|
|
54
54
|
console.log();
|
|
55
55
|
}
|
|
56
56
|
} catch {
|
|
@@ -526,30 +526,12 @@ async function cmdNew(planFile) {
|
|
|
526
526
|
process.exit(0);
|
|
527
527
|
}
|
|
528
528
|
await setupTemplates();
|
|
529
|
-
const existingFiles = [];
|
|
530
|
-
if ((0, import_node_fs3.existsSync)(config.todoFile)) existingFiles.push("TODO.md");
|
|
531
|
-
if ((0, import_node_fs3.existsSync)("specs")) existingFiles.push("specs/");
|
|
532
|
-
if (existingFiles.length > 0) {
|
|
533
|
-
console.log();
|
|
534
|
-
console.log(import_picocolors7.default.yellow("Existing files found:"));
|
|
535
|
-
for (const f of existingFiles) {
|
|
536
|
-
console.log(` - ${f}`);
|
|
537
|
-
}
|
|
538
|
-
console.log();
|
|
539
|
-
const shouldOverwrite = await confirm2({
|
|
540
|
-
message: "Overwrite these files?",
|
|
541
|
-
initialValue: false
|
|
542
|
-
});
|
|
543
|
-
if (!shouldOverwrite) {
|
|
544
|
-
console.log(import_picocolors7.default.yellow("Aborted."));
|
|
545
|
-
process.exit(0);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
529
|
if (planFile) {
|
|
549
530
|
if (!(0, import_node_fs3.existsSync)(planFile)) {
|
|
550
531
|
console.log(import_picocolors7.default.red(`Plan file not found: ${planFile}`));
|
|
551
532
|
process.exit(1);
|
|
552
533
|
}
|
|
534
|
+
await checkExistingFiles();
|
|
553
535
|
await generateFromPlan(planFile);
|
|
554
536
|
await cmdLoop();
|
|
555
537
|
return;
|
|
@@ -583,10 +565,12 @@ async function cmdNew(planFile) {
|
|
|
583
565
|
console.log(import_picocolors7.default.red(`Plan file not found: ${planPath}`));
|
|
584
566
|
process.exit(1);
|
|
585
567
|
}
|
|
568
|
+
await checkExistingFiles();
|
|
586
569
|
await generateFromPlan(planPath);
|
|
587
570
|
break;
|
|
588
571
|
}
|
|
589
572
|
case "describe":
|
|
573
|
+
await checkExistingFiles();
|
|
590
574
|
await interactiveDescribe();
|
|
591
575
|
break;
|
|
592
576
|
case "existing":
|
|
@@ -619,6 +603,29 @@ async function cmdNew(planFile) {
|
|
|
619
603
|
break;
|
|
620
604
|
}
|
|
621
605
|
}
|
|
606
|
+
async function checkExistingFiles() {
|
|
607
|
+
const existingFiles = [];
|
|
608
|
+
if ((0, import_node_fs3.existsSync)(config.todoFile)) existingFiles.push("TODO.md");
|
|
609
|
+
if ((0, import_node_fs3.existsSync)("specs")) existingFiles.push("specs/");
|
|
610
|
+
if (existingFiles.length === 0) {
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
console.log();
|
|
614
|
+
console.log(import_picocolors7.default.yellow("Existing files found:"));
|
|
615
|
+
for (const f of existingFiles) {
|
|
616
|
+
console.log(` - ${f}`);
|
|
617
|
+
}
|
|
618
|
+
console.log();
|
|
619
|
+
const shouldOverwrite = await confirm2({
|
|
620
|
+
message: "Overwrite these files?",
|
|
621
|
+
initialValue: false
|
|
622
|
+
});
|
|
623
|
+
if (!shouldOverwrite) {
|
|
624
|
+
console.log(import_picocolors7.default.yellow("Aborted."));
|
|
625
|
+
process.exit(0);
|
|
626
|
+
}
|
|
627
|
+
return true;
|
|
628
|
+
}
|
|
622
629
|
async function setupTemplates() {
|
|
623
630
|
if ((0, import_node_fs3.existsSync)(LOCAL_TEMPLATES_DIR)) {
|
|
624
631
|
console.log(import_picocolors7.default.dim(`Templates already exist at ${LOCAL_TEMPLATES_DIR}`));
|