Skip to content

fix(brew): expose greywatch alias in PATH via cask binary target#95

Merged
tito merged 1 commit into
mainfrom
fix/brew-greywatch-alias
May 20, 2026
Merged

fix(brew): expose greywatch alias in PATH via cask binary target#95
tito merged 1 commit into
mainfrom
fix/brew-greywatch-alias

Conversation

@tito
Copy link
Copy Markdown
Contributor

@tito tito commented May 20, 2026

Summary

  • brew install --cask greywall was supposed to install both greywall and the greywatch alias, but greywatch was missing from $PATH. The hooks.post.install block created a symlink inside staged_path (/opt/homebrew/Caskroom/greywall/<ver>/greywatch), which Homebrew never links into ${HOMEBREW_PREFIX}/bin — only binary stanzas get exposed there.
  • Replace the dead File.symlink with a custom_block that injects binary "greywall", target: "greywatch". Brew now creates and tracks the alias symlink (cleaned up on uninstall). custom_block is needed because goreleaser's binaries: list does not support the target: option (verified against the upstream HomebrewCask struct and cask.rb template).
  • Non-brew install paths were already correct: install.sh creates $INSTALL_DIR/greywatch, make build creates a local symlink, and the README documents the manual ln -s step for go install users.

Test plan

  • Next release: confirm the generated cask in GreyhavenHQ/homebrew-tap contains both binary "greywall" and binary "greywall", target: "greywatch".
  • After release: brew install --cask greywall on a clean Mac, verify which greywatch resolves to ${HOMEBREW_PREFIX}/bin/greywatch and greywatch --help shows observability mode.
  • brew uninstall --cask greywall removes both greywall and greywatch symlinks.

The previous post-install hook created a `greywatch` symlink inside
`staged_path` (Caskroom dir), but only `binary` stanzas get linked into
`${HOMEBREW_PREFIX}/bin`, so `greywatch` was missing from PATH after
`brew install --cask greywall` despite the README claiming otherwise.

Replace the dead File.symlink with a `custom_block` injecting
`binary "greywall", target: "greywatch"`. Brew now manages the alias
symlink and removes it on uninstall.
@tito tito merged commit ffb2515 into main May 20, 2026
4 checks passed
@tito tito deleted the fix/brew-greywatch-alias branch May 20, 2026 22:54
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