The indentation in CONTRIBUTING.md implies that :script accepts a hash.
But that is not the case. Instead :script accesses the entire hash defined
by uninstall. Unrelated install keys such as :quit leak through to
@command.run! when attempting to exec :script. Result: contrary to docs,
:script cannot be combined with other uninstall keys.
This PR makes uninstall :script accept a hash. When :args or :input are not
needed, :script can still accept a plain string, so many Casks require no
alteration.
In addition
- adds key :executable, required when using hash argument to :script
- keys to :script are validated and sanitized before being passed to
@command.run!
- adds :quit to with-installable.rb test to protect against regression
on leaky keys
accepts a single argument, which is a relative path to a pkg
inside the extracted Cask; homebrew-cask will attempt to install this
pkg after the Cask is extracted via `installer`
because of the many different ways uninstallers work, this
has several features:
- `:script`: a script in the Cask which serves as an uninstaller (e.g.
Vagrant, VirtualBox), uses `:args`, and `:input` keys to interact
with said script
- `:pkgutil`: a regexp which captures all package_ids installed by this
cask; homebrew-cask will list all files installed under these ids and
remove them
- `:launchctl`: a list of bundle_ids for services that should be
removed by homebrew-cask
- `:files`: a fallback list of files to manually remove; helps when
uninstallers miss something
refs #661
`md5`, `sha1`, `sha256` all take a hexdigest string, e.g:
sha1 'f645e9da45a621415a07a7492c45923b1a1fd4d4'
`no_checksum` takes no argument, and indicates there is no checksum
for this cask. This is *not recommended*, and should only be used for
casks that have no versioned downloads.
`brew cask install` will complain if there is no sum provided (unless
`no_checksum` has been invoked), or if the sums do not match. It will
provide the computed checksum so the cask can be easily amended.
Adapted from @passcod's work in 82cc199ae6