summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-10-29 11:53:25 -0400
committerDax Raad <[email protected]>2025-10-29 11:53:25 -0400
commit4d6e2d8efc483796c02738dca5827a776acbb152 (patch)
tree4ad1da32ee46b15b25e76d2c5eb7a3ef6a9a69af /packages
parent4407d5d96f5a2f1225b52238c186ce9820debac3 (diff)
downloadopencode-4d6e2d8efc483796c02738dca5827a776acbb152.tar.gz
opencode-4d6e2d8efc483796c02738dca5827a776acbb152.zip
autoupgrade latest major only
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/installation/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts
index 19c6674cc..f2df5b409 100644
--- a/packages/opencode/src/installation/index.ts
+++ b/packages/opencode/src/installation/index.ts
@@ -142,7 +142,9 @@ export namespace Installation {
export const USER_AGENT = `opencode/${CHANNEL}/${VERSION}`
export async function latest() {
- return fetch(`https://registry.npmjs.org/opencode-ai/${CHANNEL}`)
+ const [major] = VERSION.split(".").map((x) => Number(x))
+ const channel = CHANNEL === "latest" ? `latest-${major}` : CHANNEL
+ return fetch(`https://registry.npmjs.org/opencode-ai/${channel}`)
.then((res) => {
if (!res.ok) throw new Error(res.statusText)
return res.json()