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.tsindex 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()) returnconst config = await GlobalConfig.get()if (config.autoupdate === false) returnconst latest = await Installation.latest()if (Installation.VERSION === latest) returnconst method = await Installation.method()+ if (method === "unknown") returnawait Installation.upgrade(method, latest).catch(() => {})})()diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.tsindex 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()