Skip to content

fix(update): -force must not switch macOS to the package when the zip exists - #22

Merged
christiangda merged 1 commit into
mainfrom
fix/update-force-in-place
Sep 19, 2026
Merged

christiangda merged 1 commit into
mainfrom
fix/update-force-in-place

Conversation

@christiangda

Copy link
Copy Markdown
Contributor

Found by the first real machineid update run against the published v0.2.0 assets.

Bug. From a go installed copy (outside /usr/local/bin), machineid update -yes -force -version v0.2.0 picked the .pkg instead of the universal zip and failed with root privileges are required. chooseReleaseAsset short-circuited on opts.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. -force keeps its two documented meanings (override the target guard, reinstall an equal version). When the release has no zip, -force still falls through to the package and /usr/local/bin, as the remedy says.

New test TestUpdaterDarwinForceReinstallsInPlace pins the in-place path without root or the installer.

🤖 Generated with Claude Code

…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>
@christiangda christiangda self-assigned this Sep 19, 2026
@christiangda
christiangda merged commit fc0c4c7 into main Sep 19, 2026
7 checks passed
@christiangda
christiangda deleted the fix/update-force-in-place branch September 19, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant