Skip to content

Instantly share code, notes, and snippets.

@n0ts
Last active April 15, 2020 15:30
Show Gist options
  • Save n0ts/94693a99756c1f47c94f5b2c005530e8 to your computer and use it in GitHub Desktop.
Save n0ts/94693a99756c1f47c94f5b2c005530e8 to your computer and use it in GitHub Desktop.
brew cask upgrade
#!/bin/bash
for c in $(brew cask list); do
info=$(brew cask info $c)
installed_ver=$(echo "$info" | cut -d$'\n' -f1 | tr -d ' ' | cut -d':' -f 2)
current_ver=$(echo "$info" | cut -d$'\n' -f3 | cut -d' ' -f 1 | rev | cut -d'/' -f 1 | rev)
if [ "$installed_ver" != "$current_ver" ]; then
echo "$c is installed '$installed_ver', current is '$current_ver'"
brew cask reinstall $c
fi
done
@qd3v
Copy link

qd3v commented Jun 6, 2017

Any downside of this solution? :

brew cask reinstall `brew cask outdated`

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