Created
December 7, 2015 21:57
-
-
Save ar1g/3085896802479926b992 to your computer and use it in GitHub Desktop.
upgrade casks
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
| # 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