Created
September 4, 2014 06:59
-
-
Save gtramontina/920778416819e755e2ff to your computer and use it in GitHub Desktop.
brew_cask_install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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