fix(brew): expose greywatch alias in PATH via cask binary target#95
Merged
Conversation
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.
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
brew install --cask greywallwas supposed to install bothgreywalland thegreywatchalias, butgreywatchwas missing from$PATH. Thehooks.post.installblock created a symlink insidestaged_path(/opt/homebrew/Caskroom/greywall/<ver>/greywatch), which Homebrew never links into${HOMEBREW_PREFIX}/bin— onlybinarystanzas get exposed there.File.symlinkwith acustom_blockthat injectsbinary "greywall", target: "greywatch". Brew now creates and tracks the alias symlink (cleaned up on uninstall).custom_blockis needed because goreleaser'sbinaries:list does not support thetarget:option (verified against the upstreamHomebrewCaskstruct andcask.rbtemplate).install.shcreates$INSTALL_DIR/greywatch,make buildcreates a local symlink, and the README documents the manualln -sstep forgo installusers.Test plan
GreyhavenHQ/homebrew-tapcontains bothbinary "greywall"andbinary "greywall", target: "greywatch".brew install --cask greywallon a clean Mac, verifywhich greywatchresolves to${HOMEBREW_PREFIX}/bin/greywatchandgreywatch --helpshows observability mode.brew uninstall --cask greywallremoves bothgreywallandgreywatchsymlinks.