Fix Dolt backend init/daemon/doctor; prevent accidental SQLite artifacts; add integration tests; clean up lint (#1218)
* /{cmd,internal}: get dolt backend init working and allow issue creation
* /{website,internal,docs,cmd}: integration tests and more split backend fixes
* /{cmd,internal}: fix lint issues
* /cmd/bd/doctor/integrity.go: fix unable to query issues bug with dolt backend
* /cmd/bd/daemon.go: remove debug logging
This commit is contained in:
19
cmd/bd/doctor/backend.go
Normal file
19
cmd/bd/doctor/backend.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package doctor
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/steveyegge/beads/internal/configfile"
|
||||
)
|
||||
|
||||
// getBackendAndBeadsDir resolves the effective .beads directory (following redirects)
|
||||
// and returns the configured storage backend ("sqlite" by default, or "dolt").
|
||||
func getBackendAndBeadsDir(repoPath string) (backend string, beadsDir string) {
|
||||
beadsDir = resolveBeadsDir(filepath.Join(repoPath, ".beads"))
|
||||
|
||||
cfg, err := configfile.Load(beadsDir)
|
||||
if err != nil || cfg == nil {
|
||||
return configfile.BackendSQLite, beadsDir
|
||||
}
|
||||
return cfg.GetBackend(), beadsDir
|
||||
}
|
||||
Reference in New Issue
Block a user