allow customizing DB location

This commit is contained in:
Dax Raad
2026-03-20 22:49:55 -04:00
parent dc0044882c
commit 5dc47905a9
3 changed files with 15 additions and 5 deletions

View File

@@ -28,6 +28,10 @@ const log = Log.create({ service: "db" })
export namespace Database {
export const Path = iife(() => {
if (Flag.OPENCODE_DB) {
if (path.isAbsolute(Flag.OPENCODE_DB)) return Flag.OPENCODE_DB
return path.join(Global.Path.data, Flag.OPENCODE_DB)
}
const channel = Installation.CHANNEL
if (["latest", "beta"].includes(channel) || Flag.OPENCODE_DISABLE_CHANNEL_DB)
return path.join(Global.Path.data, "opencode.db")