Skip to content

feat: self-update installs that didn't come from Homebrew - #36

Merged
brtkwr merged 1 commit into
mainfrom
feat/self-replace
Sep 23, 2026
Merged

brtkwr merged 1 commit into
mainfrom
feat/self-replace

Conversation

@brtkwr

@brtkwr brtkwr commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

The update popup now offers Enter-to-update for every kind of install, not just Homebrew. How it updates depends on where the running ccs lives:

  • Installed with Homebrew (inside a /Cellar/ folder): unchanged. It only ever runs brew update && brew upgrade ccs and never overwrites the file itself, so ccs and the formula can't disagree.
  • Installed with Nix (/nix/…): the store is read-only, so it shows the "new version available" notice only.
  • Anything else (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's checksums.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

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
@brtkwr
brtkwr merged commit c42c570 into main Sep 23, 2026
1 check passed
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