Skip to content

Instantly share code, notes, and snippets.

@seanorama
Forked from n0ts/brew-cask-upgrade.sh
Last active February 21, 2017 08:24
Show Gist options
  • Save seanorama/8b75a987bbe6ed49bef4145fa13e9f8f to your computer and use it in GitHub Desktop.
Save seanorama/8b75a987bbe6ed49bef4145fa13e9f8f to your computer and use it in GitHub Desktop.
brew cask upgrade
#!/usr/bin/env 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'"
echo brew cask reinstall ${c}
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment