MCPcopy
hub / github.com/dnote/dnote / getDBPath

Function getDBPath

pkg/cli/infra/init.go:63–75  ·  view source on GitHub ↗
(paths context.Paths, customPath string)

Source from the content-addressed store, hash-verified

61}
62
63func getDBPath(paths context.Paths, customPath string) string {
64 // If custom path is provided, use it
65 if customPath != "" {
66 return customPath
67 }
68
69 legacyDnoteDir, ok := checkLegacyDBPath()
70 if ok {
71 return fmt.Sprintf("%s/%s", legacyDnoteDir, consts.DnoteDBFileName)
72 }
73
74 return fmt.Sprintf("%s/%s/%s", paths.Data, consts.DnoteDirName, consts.DnoteDBFileName)
75}
76
77// newBaseCtx creates a minimal context with paths and database connection.
78// This base context is used for file and database initialization before

Callers 1

newBaseCtxFunction · 0.85

Calls 1

checkLegacyDBPathFunction · 0.85

Tested by

no test coverage detected