summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-10-14 13:18:40 -0500
committerGitHub <[email protected]>2025-10-14 13:18:40 -0500
commit717b5446331f8ff3034c0d35b95b832e92ffef49 (patch)
treea1197281329bf3deb8cf63d99fbe2c8332e6204c
parentc1a420717a2c57bc5c363d682a2dc0ba7e253c00 (diff)
downloadopencode-717b5446331f8ff3034c0d35b95b832e92ffef49.tar.gz
opencode-717b5446331f8ff3034c0d35b95b832e92ffef49.zip
fix: false positive package manager detection in upgrade (#3181)
-rw-r--r--packages/opencode/src/cli/cmd/upgrade.ts16
-rw-r--r--packages/opencode/src/installation/index.ts1
2 files changed, 14 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/cmd/upgrade.ts b/packages/opencode/src/cli/cmd/upgrade.ts
index 8c1abdeab..65f3bab4d 100644
--- a/packages/opencode/src/cli/cmd/upgrade.ts
+++ b/packages/opencode/src/cli/cmd/upgrade.ts
@@ -27,9 +27,19 @@ export const UpgradeCommand = {
const detectedMethod = await Installation.method()
const method = (args.method as Installation.Method) ?? detectedMethod
if (method === "unknown") {
- prompts.log.error(`opencode is installed to ${process.execPath} and seems to be managed by a package manager`)
- prompts.outro("Done")
- return
+ prompts.log.error(`opencode is installed to ${process.execPath} and may be managed by a package manager`)
+ const install = await prompts.select({
+ message: "Install anyways?",
+ options: [
+ { label: "Yes", value: true },
+ { label: "No", value: false },
+ ],
+ initialValue: false,
+ })
+ if (!install) {
+ prompts.outro("Done")
+ return
+ }
}
prompts.log.info("Using method: " + method)
const target = args.target ? args.target.replace(/^v/, "") : await Installation.latest()
diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts
index b01ce5f7b..95b431ecd 100644
--- a/packages/opencode/src/installation/index.ts
+++ b/packages/opencode/src/installation/index.ts
@@ -50,6 +50,7 @@ export namespace Installation {
export async function method() {
if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
+ if (process.execPath.includes(path.join(".local", "bin"))) return "curl"
const exec = process.execPath.toLowerCase()
const checks = [