feat: self-update installs that didn't come from Homebrew - #36
Merged
Merged
Conversation
The update popup now works for go install / downloaded-release installs too: ccs downloads the release archive for its OS/arch, verifies it against the release's checksums.txt, and atomically renames the new binary over itself. Homebrew kegs are still only ever upgraded through brew and never overwritten, and Nix store paths get the notice only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JUmkVYwbkobda1AnHuwFDE
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.
The update popup now offers Enter-to-update for every kind of install, not just Homebrew. How it updates depends on where the running
ccslives:/Cellar/folder): unchanged. It only ever runsbrew update && brew upgrade ccsand never overwrites the file itself, so ccs and the formula can't disagree./nix/…): the store is read-only, so it shows the "new version available" notice only.go install, a downloaded release, a copy in/usr/local/bin): ccs downloads that release's file for this machine, checks it against the release'schecksums.txt, and swaps the new binary in place of itself in one step, so there's never a half-written file. If the folder isn't writable, the popup shows a clear "can't write to …" error and nothing changes. ccs then restarts from the same path.Tested against a local fake release server: a good update, a tampered checksum (the binary is left alone), and a read-only folder. Also run once against the real v0.25.0 release: the downloaded binary runs and reports v0.25.0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JUmkVYwbkobda1AnHuwFDE