Skip to content

feat(cli): add --version flag and Homebrew tap scaffolding (#46) - #58

Merged
scott merged 1 commit into
mainfrom
feat/46-homebrew-tap
Aug 23, 2026
Merged

feat(cli): add --version flag and Homebrew tap scaffolding (#46)#58
scott merged 1 commit into
mainfrom
feat/46-homebrew-tap

Conversation

@scott

@scott scott commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a top-level --version flag (and gander version subcommand) that prints the version and exits 0
  • Rewrite the README install section to lead with Homebrew: brew tap gandermd/gander && brew install gander. Demote install.sh to a "fallback / non-Homebrew systems" subsection.
  • Add scripts/bump-homebrew.sh <version> that wraps brew bump-formula-pr so each release auto-opens a PR against the gandermd/homebrew-gander tap.

Related Issue

Closes #46

Companion repo

gandermd/homebrew-gander will be created in a follow-up PR (separate repo, separate PR). It contains:

  • Formula/gander.rb pinned at v0.11.0 (multi-arch: on_macos/on_linux × arm64/amd64); man and completions tarballs attached to the v0.11.0 release are pulled in as resource blocks
  • LICENSE (MIT, copy of upstream)
  • README.md and .github/workflows/audit.yml running brew audit --strict

Testing

  • go test ./... passes (including new TestPrintVersion)
  • go vet ./... clean
  • CGO_ENABLED=0 go build -o gander . succeeds; ./gander --version prints gander dev and exits 0
  • scripts/bump-homebrew.sh --help prints usage and exits 0
  • scripts/bump-homebrew.sh --dry-run 0.11.0 validates the v0.11.0 release exists and prints the brew bump-formula-pr invocation without executing it

Notes

  • --version was needed for the Homebrew formula's test do block: running the binary with no args hits runNoArg, which calls fetchLatestRelease() — that touches the network and is blocked in Homebrew's sandbox. With --version, the test can assert the version string instead.
  • Asset naming (gander-{goos}-{goarch}) is unchanged. assetNameForRuntime in upgrade.go continues to match.
  • gander --upgrade continues to work for users installed via Homebrew: the GitHub release URL contract is unchanged.

Adds a top-level `--version` flag (and `gander version` subcommand) that
prints the version and exits 0. This lets the Homebrew formula's `test do`
block assert the version string without triggering `fetchLatestRelease` (which
would fail in Homebrew's network-isolated sandbox).

Rewrites the README install section so Homebrew leads:

  brew tap gandermd/gander
  brew install gander

The `curl | bash install.sh` one-liner is demoted to a 'fallback /
non-Homebrew systems' subsection; the rest of the install flow is unchanged.

Adds `scripts/bump-homebrew.sh <version>`, a thin wrapper around
`brew bump-formula-pr` that opens a PR against gandermd/homebrew-gander
after each release. Documented in the Releasing section.
@scott
scott merged commit f89c72a into main Aug 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.

feat: distribute gander via Homebrew (personal tap)

1 participant