feat: add choco and scoop to opencode upgrade methods #8439
+55
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds support for
opencode upgradeto work with Chocolatey and Scoop installations. This works by addingchocoandscoopcommands to the relevant methods in theInstallationnamespace -Installation.method: addchoco listandscoop listcommandsInstallation.upgrade: addchoco upgrade --version=<target>andscoop install opencode@<target>commandsInstallation.latest: fetch the latest version number of thechocoandscoopopencode packages from public manifest URLsHow did you verify your code works?
Chocolatey
Scoop
Notify Update
latest()pulls in the right version for our chocolatey based install (1.1.18at the time of this PR whereas latest release is on1.1.19Not an Elevated Command Shell
Chocolatey has an annoying issue where it doesn't allow installation or upgrading a package if you're not in an elevated command shell. This "error" also passes to
stdoutand notstderrso we pass a custom error message to theUpgradeFailedErrorso we can capture it in theupgrade.tsand communicate this to the user.Output of
upgradew/ a non-elevated command shell (this has been tested oncmdand non-elevatedpowershell.