Repository navigation
feat: add self-update command to install the latest release in place - #18
Merged
Merged
Conversation
Download the release archive for the current OS/arch, verify it against checksums.txt, and atomically replace the running binary. Includes --check to only report availability and points the update notice at the command. Also make the version ldflags override effective (the computed initializer made -X a no-op) and ignore +build metadata when comparing versions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <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.
Summary
github-pokemon self-updatecommand (and--check): fetches the latest release, downloads the archive for the current OS/arch, verifies its sha256 against the releasechecksums.txt(refuses to install if missing or mismatched), extracts the binary, and replaces the running executable via a temp file + rename in the same directory. On Windows the old binary is renamed aside first. Permission errors suggest re-running with privileges.github-pokemon self-update.versionhad a computed initializer, so GoReleaser's-X ...cmd.versionwas silently ignored. It's now a plain string resolved at startup (ldflags first, then build info, then0.0.0-dev).+buildmetadata (e.g.1.5.0+dirty) is ignored when comparing versions.Test plan
go build/go vet/go testself-updateagainst the live v1.5.0 release; checksum verified and the binary was replaced (--versionreports 1.5.0)🤖 Generated with Claude Code