Skip to content

Commit 56d802b

Browse files
fix: rename opencode → altimate-code across all install/upgrade paths
6 fixes in installation/index.ts: 1. method() detection: add .altimate-code path check for curl installs 2. scoop detection: opencode → altimate-code in list command 3. choco detection: opencode → altimate-code in list command 4. scoop upgrade: opencode@{version} → altimate-code@{version} 5. choco upgrade: opencode → altimate-code package name 6. choco error: remove hardcoded error message, use actual stderr 7. scoop latest: opencode.json → altimate-code.json URL 8. choco latest: opencode → altimate-code in API query 9. installedName: scoop/choco detect altimate-code not opencode Found by install matrix CI — 55 combinations across npm, npx, pnpm, bun, brew, curl, scoop, choco on Ubuntu, macOS, Windows.
1 parent 0612f4e commit 56d802b

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

  • packages/opencode/src/installation

packages/opencode/src/installation/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export namespace Installation {
101101

102102
export async function method() {
103103
if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
104+
if (process.execPath.includes(path.join(".altimate-code", "bin"))) return "curl"
104105
if (process.execPath.includes(path.join(".local", "bin"))) return "curl"
105106
const exec = process.execPath.toLowerCase()
106107

@@ -129,11 +130,11 @@ export namespace Installation {
129130
// altimate_change end
130131
{
131132
name: "scoop" as const,
132-
command: () => text(["scoop", "list", "opencode"]),
133+
command: () => text(["scoop", "list", "altimate-code"]),
133134
},
134135
{
135136
name: "choco" as const,
136-
command: () => text(["choco", "list", "--limit-output", "opencode"]),
137+
command: () => text(["choco", "list", "--limit-output", "altimate-code"]),
137138
},
138139
]
139140

@@ -149,7 +150,7 @@ export namespace Installation {
149150
const output = await check.command()
150151
// altimate_change start — package names for detection
151152
const installedName =
152-
check.name === "brew" ? "altimate-code" : check.name === "choco" || check.name === "scoop" ? "opencode" : "@altimateai/altimate-code"
153+
check.name === "brew" ? "altimate-code" : check.name === "choco" || check.name === "scoop" ? "altimate-code" : "@altimateai/altimate-code"
153154
// altimate_change end
154155
if (output.includes(installedName)) {
155156
return check.name
@@ -222,19 +223,18 @@ export namespace Installation {
222223
}
223224

224225
case "choco":
225-
result = await Process.run(["choco", "upgrade", "opencode", `--version=${target}`, "-y"], { nothrow: true })
226+
result = await Process.run(["choco", "upgrade", "altimate-code", `--version=${target}`, "-y"], { nothrow: true })
226227
break
227228
case "scoop":
228-
result = await Process.run(["scoop", "install", `opencode@${target}`], { nothrow: true })
229+
result = await Process.run(["scoop", "install", `altimate-code@${target}`], { nothrow: true })
229230
break
230231
default:
231232
throw new Error(`Unknown method: ${method}`)
232233
}
233234
// altimate_change start — telemetry for upgrade result
234235
const telemetryMethod = (["npm", "bun", "brew"].includes(method) ? method : "other") as "npm" | "bun" | "brew" | "other"
235236
if (!result || result.code !== 0) {
236-
const stderr =
237-
method === "choco" ? "not running from an elevated command shell" : result?.stderr.toString("utf8") || ""
237+
const stderr = result?.stderr.toString("utf8") || "upgrade failed (unknown error)"
238238
const T = await getTelemetry()
239239
T.track({
240240
type: "upgrade_attempted",
@@ -317,7 +317,7 @@ export namespace Installation {
317317

318318
if (detectedMethod === "choco") {
319319
return fetch(
320-
"https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27opencode%27%20and%20IsLatestVersion&$select=Version",
320+
"https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27altimate-code%27%20and%20IsLatestVersion&$select=Version",
321321
{ headers: { Accept: "application/json;odata=verbose" } },
322322
)
323323
.then((res) => {
@@ -328,7 +328,7 @@ export namespace Installation {
328328
}
329329

330330
if (detectedMethod === "scoop") {
331-
return fetch("https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/opencode.json", {
331+
return fetch("https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/altimate-code.json", {
332332
headers: { Accept: "application/json" },
333333
})
334334
.then((res) => {

0 commit comments

Comments
 (0)