fix(update): -force must not switch macOS to the package when the zip exists - #22
Merged
Merged
Conversation
…zip exists With -force, chooseReleaseAsset returned the .pkg for a binary outside /usr/local/bin, so reinstalling an equal version in place (the documented use of -force) failed with "root privileges are required". -force now only affects the target guard and the equal-version check; the asset choice depends solely on where the binary lives and what the release carries. Found by the first real update run against v0.2.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Found by the first real
machineid updaterun against the published v0.2.0 assets.Bug. From a
go installed copy (outside/usr/local/bin),machineid update -yes -force -version v0.2.0picked the.pkginstead of the universal zip and failed withroot privileges are required.chooseReleaseAssetshort-circuited onopts.Force, so the flag documented as "reinstall an equal version" also flipped the install method.Fix. The asset choice depends only on where the running binary lives and what the release carries.
-forcekeeps its two documented meanings (override the target guard, reinstall an equal version). When the release has no zip,-forcestill falls through to the package and/usr/local/bin, as the remedy says.New test
TestUpdaterDarwinForceReinstallsInPlacepins the in-place path without root or the installer.🤖 Generated with Claude Code