In the simple case of a string argument to binary
, the source file is linked into the $(brew --prefix)/bin
directory (typically /usr/local/bin
) on installation. For example (from operadriver.rb):
binary "operadriver"
creates a symlink to:
$(brew --prefix)/bin/operadriver
from a source file such as:
/usr/local/Caskroom/operadriver/0.2.2/operadriver
A binary (or multiple) can also be contained in an application bundle:
app "Atom.app"
binary "#{appdir}/Atom.app/Contents/Resources/app/apm/bin/apm"
You can rename the target which appears in your binaries directory by adding a target:
key to binary
:
binary "#{appdir}/Atom.app/Contents/Resources/app/atom.sh", target: "atom"
Behaviour and usage of target:
is the same as with app
. However, for binary
the select cases don’t apply as rigidly. It’s fine to take extra liberties with target:
to be consistent with other command-line tools, like changing case, removing an extension, or cleaning up the name.