chiefwiggum 1.3.22 → 1.3.23
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 +30 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -626,14 +626,27 @@ async function cmdLoop() {
|
|
|
626
626
|
var __dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
627
627
|
var LOCAL_TEMPLATES_DIR = ".chiefwiggum/templates";
|
|
628
628
|
var CONFIG_FILE = ".chiefwiggum/CLAUDE.md";
|
|
629
|
+
function stripTrailingCommas(json) {
|
|
630
|
+
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
631
|
+
}
|
|
629
632
|
function getConfig() {
|
|
630
633
|
if (!(0, import_node_fs3.existsSync)(CONFIG_FILE)) {
|
|
631
634
|
return { projectTracker: "todo" };
|
|
632
635
|
}
|
|
636
|
+
const raw = (0, import_node_fs3.readFileSync)(CONFIG_FILE, "utf-8");
|
|
633
637
|
try {
|
|
634
|
-
return JSON.parse(
|
|
638
|
+
return JSON.parse(raw);
|
|
635
639
|
} catch {
|
|
636
|
-
|
|
640
|
+
try {
|
|
641
|
+
const fixed = stripTrailingCommas(raw);
|
|
642
|
+
const config2 = JSON.parse(fixed);
|
|
643
|
+
console.log(import_picocolors7.default.yellow("Note: Fixed trailing comma in config file."));
|
|
644
|
+
saveConfig(config2);
|
|
645
|
+
return config2;
|
|
646
|
+
} catch {
|
|
647
|
+
console.log(import_picocolors7.default.yellow("Warning: Could not parse config file. Using defaults."));
|
|
648
|
+
return { projectTracker: "todo" };
|
|
649
|
+
}
|
|
637
650
|
}
|
|
638
651
|
}
|
|
639
652
|
function saveConfig(config2) {
|
|
@@ -1342,14 +1355,27 @@ var import_node_fs5 = require("fs");
|
|
|
1342
1355
|
var import_node_child_process7 = require("child_process");
|
|
1343
1356
|
var import_picocolors9 = __toESM(require("picocolors"), 1);
|
|
1344
1357
|
var CONFIG_FILE2 = ".chiefwiggum/CLAUDE.md";
|
|
1358
|
+
function stripTrailingCommas2(json) {
|
|
1359
|
+
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
1360
|
+
}
|
|
1345
1361
|
function getConfig2() {
|
|
1346
1362
|
if (!(0, import_node_fs5.existsSync)(CONFIG_FILE2)) {
|
|
1347
1363
|
return { projectTracker: "todo" };
|
|
1348
1364
|
}
|
|
1365
|
+
const raw = (0, import_node_fs5.readFileSync)(CONFIG_FILE2, "utf-8");
|
|
1349
1366
|
try {
|
|
1350
|
-
return JSON.parse(
|
|
1367
|
+
return JSON.parse(raw);
|
|
1351
1368
|
} catch {
|
|
1352
|
-
|
|
1369
|
+
try {
|
|
1370
|
+
const fixed = stripTrailingCommas2(raw);
|
|
1371
|
+
const config2 = JSON.parse(fixed);
|
|
1372
|
+
console.log(import_picocolors9.default.yellow("Note: Fixed trailing comma in config file."));
|
|
1373
|
+
saveConfig2(config2);
|
|
1374
|
+
return config2;
|
|
1375
|
+
} catch {
|
|
1376
|
+
console.log(import_picocolors9.default.yellow("Warning: Could not parse config file. Using defaults."));
|
|
1377
|
+
return { projectTracker: "todo" };
|
|
1378
|
+
}
|
|
1353
1379
|
}
|
|
1354
1380
|
}
|
|
1355
1381
|
function saveConfig2(config2) {
|