@morebeans/cli 2.3.1 → 2.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/index.ts +12 -22
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
|
15
15
|
import { join, resolve } from "path";
|
|
16
16
|
import { homedir } from "os";
|
|
17
17
|
|
|
18
|
-
const VERSION = "2.3.
|
|
18
|
+
const VERSION = "2.3.2";
|
|
19
19
|
const BEANS_HOME = join(homedir(), ".beans");
|
|
20
20
|
const BEANS_CONFIG = join(BEANS_HOME, "config.json");
|
|
21
21
|
|
|
@@ -385,39 +385,29 @@ async function cmdDoctor(args: string[]) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
// Check beads database (
|
|
388
|
+
// Check beads database (supports both .beans and legacy .beads locations)
|
|
389
389
|
const beansDir = join(cwd, ".beans");
|
|
390
|
-
const
|
|
390
|
+
const legacyBeadsDir = join(cwd, ".beads");
|
|
391
391
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const result = await $`bd doctor --fix`.nothrow();
|
|
400
|
-
if (result.exitCode !== 0) {
|
|
401
|
-
warn("bd doctor reported issues (see output above)");
|
|
402
|
-
} else {
|
|
403
|
-
fixed++;
|
|
404
|
-
}
|
|
405
|
-
} catch {
|
|
406
|
-
warn("bd doctor failed");
|
|
407
|
-
}
|
|
408
|
-
}
|
|
392
|
+
const hasBeadsInBeans = existsSync(join(beansDir, "beads.db")) || existsSync(join(beansDir, "issues.jsonl"));
|
|
393
|
+
const hasLegacyBeads = existsSync(join(legacyBeadsDir, "beads.db")) || existsSync(join(legacyBeadsDir, "issues.jsonl"));
|
|
394
|
+
|
|
395
|
+
if (hasBeadsInBeans) {
|
|
396
|
+
success(".beans/ (issue tracker)");
|
|
397
|
+
} else if (hasLegacyBeads) {
|
|
398
|
+
success(".beads/ (issue tracker - legacy location)");
|
|
409
399
|
} else {
|
|
410
400
|
if (fix) {
|
|
411
401
|
info("Initializing beads (bd init)...");
|
|
412
402
|
try {
|
|
413
403
|
await $`bd init`.nothrow();
|
|
414
|
-
success("beads initialized
|
|
404
|
+
success("beads initialized");
|
|
415
405
|
fixed++;
|
|
416
406
|
} catch {
|
|
417
407
|
warn("bd init failed - run manually");
|
|
418
408
|
}
|
|
419
409
|
} else {
|
|
420
|
-
warn("
|
|
410
|
+
warn("Issue tracker not initialized (run 'beans doctor --fix' or 'bd init')");
|
|
421
411
|
}
|
|
422
412
|
}
|
|
423
413
|
|