Skip to content

The open source coding agent.

TypeScript

do not autoupgrade snapshot builds

Dax Raad9c5616521de2
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts
index 1995f2ebec0..cb4bffe0056 100644
--- a/packages/opencode/src/index.ts
+++ b/packages/opencode/src/index.ts
@@ -20,11 +20,13 @@ import { GlobalConfig } from "./global/config"
import { Installation } from "./installation"
;(async () => {
if (Installation.VERSION === "dev") return
+ if (Installation.isSnapshot()) return
const config = await GlobalConfig.get()
if (config.autoupdate === false) return
const latest = await Installation.latest()
if (Installation.VERSION === latest) return
const method = await Installation.method()
+ if (method === "unknown") return
await Installation.upgrade(method, latest).catch(() => {})
})()
diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts
index 6bc245d9f61..335a8adeee7 100644
--- a/packages/opencode/src/installation/index.ts
+++ b/packages/opencode/src/installation/index.ts
@@ -23,6 +23,10 @@ export namespace Installation {
}
}
+ export function isSnapshot() {
+ return VERSION.startsWith("0.0.0")
+ }
+
export async function method() {
if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
const exec = process.execPath.toLowerCase()