Skip to content

Instantly share code, notes, and snippets.

@childnode
Last active March 9, 2017 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save childnode/d35cf810dd28775ac5c0e491107215fd to your computer and use it in GitHub Desktop.
Save childnode/d35cf810dd28775ac5c0e491107215fd to your computer and use it in GitHub Desktop.
brew-cask-check-updates
for cask in $(brew cask list -1); do
echo -n "${cask} : ";
caskLatest=$(brew cask info $cask | head -1 | awk -F: '{print $2}' | tr -d '[[:space:]]');
caskCurrentDir=$(brew cask info $cask | grep -e "^$(brew --prefix).*/${cask}/"| head -1| awk '{print $1}');
[ ! -d $(dirname ${caskCurrentDir})/${caskLatest} ] && echo "outdated : ("$(basename ${caskCurrentDir})" -> "${caskLatest}")" || echo "current";
done
@childnode
Copy link
Author

childnode commented Mar 9, 2017

This is a type of q'n'dirty "workaround"
to update all outdated casks e.g.:
. ./brew-cask-check-updates.bash | awk -F: '{if ($2 ~ "outdated") print $1}' | xargs brew cask reinstall

other 'hacks' found:
https://gist.github.com/atais/9c72e469b1cbec35c7c430ce03de2a6b
or
https://github.com/buo/homebrew-cask-upgrade
via

see right place to discuss the clean solution: Homebrew/homebrew-cask#29301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment