Skip to content

Instantly share code, notes, and snippets.

@ar1g
Created December 7, 2015 21:57
Show Gist options
  • Save ar1g/3085896802479926b992 to your computer and use it in GitHub Desktop.
Save ar1g/3085896802479926b992 to your computer and use it in GitHub Desktop.
upgrade casks
# from http://stackoverflow.com/a/32234553
brew-cask-upgrade() {
if [ "$1" != '--continue' ]; then
echo "Removing brew cache"
rm -rf "$(brew --cache)"
echo "Running brew update"
brew update
fi
for c in $(brew cask list); do
echo -e "\n\nInstalled versions of $c: "
ls /opt/homebrew-cask/Caskroom/$c
echo "Cask info for $c"
brew cask info $c
select ynx in "Yes" "No" "Exit"; do
case $ynx in
"Yes") echo "Uninstalling $c"; brew cask uninstall --force "$c"; echo "Re-installing $c"; brew cask install "$c"; break;;
"No") echo "Skipping $c"; break;;
"Exit") echo "Exiting brew-cask-upgrade"; return;;
esac
done
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment