MCPcopy
hub / github.com/dnote/dnote / checkLegacyDBPath

Function checkLegacyDBPath

pkg/cli/infra/init.go:49–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47type RunEFunc func(*cobra.Command, []string) error
48
49func checkLegacyDBPath() (string, bool) {
50 legacyDnoteDir := getLegacyDnotePath(dirs.Home)
51 ok, err := utils.FileExists(legacyDnoteDir)
52 if ok {
53 return legacyDnoteDir, true
54 }
55
56 if err != nil {
57 log.Error(errors.Wrapf(err, "checking legacy dnote directory at %s", legacyDnoteDir).Error())
58 }
59
60 return "", false
61}
62
63func getDBPath(paths context.Paths, customPath string) string {
64 // If custom path is provided, use it

Callers 1

getDBPathFunction · 0.85

Calls 4

FileExistsFunction · 0.92
ErrorFunction · 0.92
getLegacyDnotePathFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected