summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-07-12 12:40:38 -0400
committerDax Raad <[email protected]>2025-07-12 12:41:12 -0400
commit17fa8c117b03d34febe82712ca67fd708b67875f (patch)
tree96c0720b921a062d1cdf0d94f93221844aa79b78
parent9aa0c40a00ef8696eea499b63cf29a879a38ab34 (diff)
downloadopencode-17fa8c117b03d34febe82712ca67fd708b67875f.tar.gz
opencode-17fa8c117b03d34febe82712ca67fd708b67875f.zip
fix packages being reinstalled on every start
-rw-r--r--packages/opencode/src/bun/index.ts12
-rw-r--r--packages/opencode/src/global/index.ts2
2 files changed, 12 insertions, 2 deletions
diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts
index 0a9ee9ca9..99fa4435e 100644
--- a/packages/opencode/src/bun/index.ts
+++ b/packages/opencode/src/bun/index.ts
@@ -67,7 +67,15 @@ export namespace BunProc {
})
if (parsed.dependencies[pkg] === version) return mod
await BunProc.run(
- ["add", "--exact", "--cwd", Global.Path.cache, "--registry=https://registry.npmjs.org", pkg + "@" + version],
+ [
+ "add",
+ "--force",
+ "--exact",
+ "--cwd",
+ Global.Path.cache,
+ "--registry=https://registry.npmjs.org",
+ pkg + "@" + version,
+ ],
{
cwd: Global.Path.cache,
},
@@ -79,6 +87,8 @@ export namespace BunProc {
},
)
})
+ parsed.dependencies[pkg] = version
+ await Bun.write(pkgjson.name!, JSON.stringify(parsed, null, 2))
return mod
}
}
diff --git a/packages/opencode/src/global/index.ts b/packages/opencode/src/global/index.ts
index f4d92be7c..b083e94de 100644
--- a/packages/opencode/src/global/index.ts
+++ b/packages/opencode/src/global/index.ts
@@ -27,7 +27,7 @@ await Promise.all([
fs.mkdir(Global.Path.state, { recursive: true }),
])
-const CACHE_VERSION = "1"
+const CACHE_VERSION = "2"
const version = await Bun.file(path.join(Global.Path.cache, "version"))
.text()