Resolve merge conflicts in issues.jsonl and main.go
- issues.jsonl: Keep closed status for bd-5kj (already resolved) - main.go: Clean up JSONL-only mode detection, include BD_ACTOR env check 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -289,33 +289,35 @@ var rootCmd = &cobra.Command{
|
||||
jsonlPath := filepath.Join(beadsDir, "issues.jsonl")
|
||||
configPath := filepath.Join(beadsDir, "config.yaml")
|
||||
|
||||
// Check if JSONL exists and config.yaml has no-db: true
|
||||
// Check if JSONL exists and config.yaml has no-db: true
|
||||
jsonlExists := false
|
||||
if _, err := os.Stat(jsonlPath); err == nil {
|
||||
jsonlExists = true
|
||||
}
|
||||
|
||||
isNoDbMode := false
|
||||
isNoDbMode := false
|
||||
if configData, err := os.ReadFile(configPath); err == nil {
|
||||
isNoDbMode = strings.Contains(string(configData), "no-db: true")
|
||||
}
|
||||
|
||||
// If JSONL-only mode is configured, auto-enable it
|
||||
// If JSONL-only mode is configured, auto-enable it
|
||||
if jsonlExists && isNoDbMode {
|
||||
noDb = true
|
||||
if err := initializeNoDbMode(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error initializing JSONL-only mode: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
// Set actor from flag, viper, or env
|
||||
// Set actor for audit trail
|
||||
if actor == "" {
|
||||
if user := os.Getenv("USER"); user != "" {
|
||||
if bdActor := os.Getenv("BD_ACTOR"); bdActor != "" {
|
||||
actor = bdActor
|
||||
} else if user := os.Getenv("USER"); user != "" {
|
||||
actor = user
|
||||
} else {
|
||||
actor = "unknown"
|
||||
}
|
||||
}
|
||||
return
|
||||
return // Skip SQLite initialization
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +325,7 @@ var rootCmd = &cobra.Command{
|
||||
// - import: auto-initializes database if missing
|
||||
// - setup: creates editor integration files (no DB needed)
|
||||
if cmd.Name() != "import" && cmd.Name() != "setup" {
|
||||
// No database found - error out instead of falling back to ~/.beads
|
||||
// No database found - provide helpful error message
|
||||
fmt.Fprintf(os.Stderr, "Error: no beads database found\n")
|
||||
fmt.Fprintf(os.Stderr, "Hint: run 'bd init' to create a database in the current directory\n")
|
||||
fmt.Fprintf(os.Stderr, " or use 'bd --no-db' to work with JSONL only (no SQLite)\n")
|
||||
|
||||
Reference in New Issue
Block a user