feat(core): initial implementation of syncing (#17814)

This commit is contained in:
James Long
2026-03-25 10:47:40 -04:00
committed by GitHub
parent 0c0c6f3bdb
commit b0017bf1b9
32 changed files with 4403 additions and 1760 deletions

View File

@@ -6,14 +6,9 @@ import { Database } from "../../src/storage/db"
describe("Database.Path", () => {
test("returns database path for the current channel", () => {
const db = process.env["OPENCODE_DB"]
const expected = db
? path.isAbsolute(db)
? db
: path.join(Global.Path.data, db)
: ["latest", "beta"].includes(Installation.CHANNEL)
? path.join(Global.Path.data, "opencode.db")
: path.join(Global.Path.data, `opencode-${Installation.CHANNEL.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`)
expect(Database.Path).toBe(expected)
const expected = ["latest", "beta"].includes(Installation.CHANNEL)
? path.join(Global.Path.data, "opencode.db")
: path.join(Global.Path.data, `opencode-${Installation.CHANNEL.replace(/[^a-zA-Z0-9._-]/g, "-")}.db`)
expect(Database.getChannelPath()).toBe(expected)
})
})