Created
June 24, 2016 07:22
-
-
Save hp9390/e1c1cda7bd64a82a7bb12539255e5956 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
casks=( $(brew cask list) ) | |
for cask in ${casks[@]} | |
do | |
installed=( $(ls /opt/homebrew-cask/Caskroom/$cask)) | |
if [ ${#installed[@]} -gt 1 ]; then | |
echo "${red}${cask}${reset} has installed multiple ${red}versions${reset}." | |
(set -x; brew cask uninstall $cask --force;) | |
(set -x; brew cask install $cask --force;) | |
else | |
echo "${red}${cask}${reset} is ${green}ok${reset}." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment