Created
January 17, 2017 20:44
-
-
Save hiroshiro/6acd01a2bbd768081c94357c6a9a8d7d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fullBrewUpdate(){ | |
brew update | |
brew cask update | |
casks=( $(brew cask list) ) | |
for cask in ${casks[@]} | |
do | |
# in the first line there is version | |
current="$(brew cask info $cask | sed -n '1p' | sed -n 's/^.*: \(.*\)$/\1/p')" | |
installed=( $(ls /opt/homebrew-cask/Caskroom/$cask)) | |
if (! [[ " ${installed[@]} " == *" $current "* ]]); then | |
(set -x; brew cask install $cask --force;) | |
fi | |
done | |
brew upgrade | |
brew cleanup | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment