(paths context.Paths, customPath string)
| 61 | } |
| 62 | |
| 63 | func 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 |
no test coverage detected