Skip to content

Commit 9c56165

Browse files
committed
do not autoupgrade snapshot builds
1 parent 3fe1634 commit 9c56165

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/opencode/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ import { GlobalConfig } from "./global/config"
2020
import { Installation } from "./installation"
2121
;(async () => {
2222
if (Installation.VERSION === "dev") return
23+
if (Installation.isSnapshot()) return
2324
const config = await GlobalConfig.get()
2425
if (config.autoupdate === false) return
2526
const latest = await Installation.latest()
2627
if (Installation.VERSION === latest) return
2728
const method = await Installation.method()
29+
if (method === "unknown") return
2830
await Installation.upgrade(method, latest).catch(() => {})
2931
})()
3032

packages/opencode/src/installation/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export namespace Installation {
2323
}
2424
}
2525

26+
export function isSnapshot() {
27+
return VERSION.startsWith("0.0.0")
28+
}
29+
2630
export async function method() {
2731
if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
2832
const exec = process.execPath.toLowerCase()

0 commit comments

Comments
 (0)