Remove ~/.beads fallback behavior
- Remove ~/.beads/default.db fallback from FindDatabasePath() - Update daemon to error if no database found instead of falling back - Update main.go to require explicit database initialization - Add help/version/quickstart to commands that don't need database - Add MCP client debug logging for database routing Amp-Thread-ID: https://ampcode.com/threads/T-2b757a14-cf10-400e-a83c-30349182dd82 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -115,11 +115,8 @@ func ensureBeadsDir() (string, error) {
|
||||
if dbPath != "" {
|
||||
beadsDir = filepath.Dir(dbPath)
|
||||
} else {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("cannot resolve home directory: %w", err)
|
||||
}
|
||||
beadsDir = filepath.Join(home, ".beads")
|
||||
// No database path - error out instead of falling back to ~/.beads
|
||||
return "", fmt.Errorf("no database path configured (run 'bd init' or set BEADS_DB)")
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(beadsDir, 0700); err != nil {
|
||||
@@ -446,13 +443,10 @@ func runDaemonLoop(interval time.Duration, autoCommit, autoPush bool, logPath, p
|
||||
if foundDB := beads.FindDatabasePath(); foundDB != "" {
|
||||
daemonDBPath = foundDB
|
||||
} else {
|
||||
// Fallback to default location
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log("Error: cannot resolve home directory: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
daemonDBPath = filepath.Join(home, ".beads", "default.db")
|
||||
// No database found - error out instead of falling back to ~/.beads
|
||||
log("Error: no beads database found")
|
||||
log("Hint: run 'bd init' to create a database or set BEADS_DB environment variable")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user