In the simple case of a string argument to app
, the source file is moved to the target ~/Applications
directory. For example:
app 'Alfred 2.app'
moves the source to:
~/Applications/Alfred 2.app
from a source file such as:
/opt/homebrew-cask/Caskroom/alfred/2.8.2_431/Alfred 2.app
You can rename the target which appears in your /Applications
directory by adding a target:
key to app
. Example (from scala-ide.rb):
app 'eclipse/Eclipse.app', target: 'Scala IDE.app'
If target:
has a leading slash, it is interpreted as an absolute path. The containing directory for the absolute path will be created if it does not already exist. Example (from manopen.rb):
artifact 'openman.1', target: '/usr/local/share/man/man1/openman.1'
The target:
key works similarly for most Cask artifacts, such as app
, binary
, colorpicker
, font
, input_method
, prefpane
, qlplugin
, service
, suite
, and artifact
.
Don’t use target:
for aesthetic reasons, like removing version numbers (app "Slack #{version}.app", target: 'Slack.app'
). With app
, use it when it makes sense functionally and document your reason cleary in the Cask: was it for clarity; for consistency; to prevent conflicts; due to developer suggestion? With binary
you can take some extra liberties to be consistent with other command-line tools, like changing case or removing an extension.