Skip to content

Instantly share code, notes, and snippets.

@nikolay
Last active September 4, 2017 20:35
Show Gist options
  • Save nikolay/67e2750df8e28b186d6eb88ed96ff22f to your computer and use it in GitHub Desktop.
Save nikolay/67e2750df8e28b186d6eb88ed96ff22f to your computer and use it in GitHub Desktop.
Homebrew Cask Outdated

This script shows a more complete list of outdated casks. Here's an example:

[nikolay:~] $ brew cask outdated
[nikolay:~] $ ./cask-outdated.sh
caprine (2.6.1) < 2.6.2
dropbox (22.3.22) < latest
github-desktop (0.7.2-cb858085) < 0.8.0-364fa5b9
iterm2-beta (3.1.beta.6) < 3.1.beta.8
microsoft-office (15.33.17040900) < 15.37.17081500
quitter (1.0) < 1.0(107)
sourcetree (2.6.1b) < 2.6.2c
#!/usr/bin/env bash
main () {
local package
local info
local version
local path
for package in $(brew cask list -1); do
info="$(brew cask info ${package})"
version="$(echo "${info}" | head -1 | cut -d":" -f2 | tr -d "[:space:]")"
path="$(echo "${info}" | sed -n "3p" | cut -d" " -f1)"
if [[ "${path}" != "/usr/local/Caskroom/${package}/${version}" ]]; then
echo "${package} ($(basename "${path}")) < ${version}"
fi
done
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment