fix: verify .beads directory exists after bd init
bd init can exit with code 0 but fail to create the .beads directory when orphaned bd daemons interfere. Add explicit verification that the directory exists, with a helpful error message if not.
This commit is contained in:
@@ -399,6 +399,12 @@ func initTownBeads(townPath string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify .beads directory was actually created (bd init can exit 0 without creating it)
|
||||||
|
beadsDir := filepath.Join(townPath, ".beads")
|
||||||
|
if _, statErr := os.Stat(beadsDir); os.IsNotExist(statErr) {
|
||||||
|
return fmt.Errorf("bd init succeeded but .beads directory not created (check bd daemon interference)")
|
||||||
|
}
|
||||||
|
|
||||||
// Explicitly set issue_prefix config (bd init --prefix may not persist it in newer versions).
|
// Explicitly set issue_prefix config (bd init --prefix may not persist it in newer versions).
|
||||||
prefixSetCmd := exec.Command("bd", "config", "set", "issue_prefix", "hq")
|
prefixSetCmd := exec.Command("bd", "config", "set", "issue_prefix", "hq")
|
||||||
prefixSetCmd.Dir = townPath
|
prefixSetCmd.Dir = townPath
|
||||||
|
|||||||
Reference in New Issue
Block a user