Skip to content

Commit ffb7701

Browse files
warn users if they try to choco uninstall in non-elevated command shell
1 parent e7b97eb commit ffb7701

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/opencode/src/cli/cmd/uninstall.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,15 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar
221221
}
222222
if (result.exitCode !== 0) {
223223
spinner.stop(`Package manager uninstall failed`, 1)
224-
prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`)
224+
if (
225+
method === "choco" &&
226+
result.stdout.toString("utf8").includes("not running from an elevated command shell")
227+
) {
228+
prompts.log.warn(`You may need to run '${cmd.join(" ")}' from an elevated command shell`)
229+
} else {
230+
prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`)
231+
}
232+
225233
errors.push(`Package manager: exit code ${result.exitCode}`)
226234
} else {
227235
spinner.stop("Package removed")

0 commit comments

Comments
 (0)