Skip to content

Instantly share code, notes, and snippets.

@gtramontina
Created September 4, 2014 06:59
Show Gist options
  • Save gtramontina/920778416819e755e2ff to your computer and use it in GitHub Desktop.
Save gtramontina/920778416819e755e2ff to your computer and use it in GitHub Desktop.
brew_cask_install
brew_cask_install() {
if ! brew_cask_is_installed "$1"; then
brew cask install "$@"
fi
}
brew_cask_is_installed() {
local NAME=$(brew_cask_expand_alias "$1")
brew cask list -1 | grep -Fqx "$NAME"
}
brew_cask_expand_alias() {
brew cask info "$1" 2>/dev/null | head -1 | awk '{gsub(/:/, ""); print $1}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment