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"
by default moves the source to:
/Applications/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
, dictionary
, font
, input_method
, prefpane
, qlplugin
, mdimporter
, service
, suite
, and artifact
.
Don’t use target:
for aesthetic reasons, like removing version numbers (app "Slack #{version}.app", target: "Slack.app"
). Use it when it makes sense functionally and document your reason clearly in the Cask, using one of the templates: for clarity; for consistency; to prevent conflicts; due to developer suggestion.