Skip to content

Instantly share code, notes, and snippets.

@j6s
Created June 3, 2014 09:43
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 j6s/f876b3733ae08e95216f to your computer and use it in GitHub Desktop.
Save j6s/f876b3733ae08e95216f to your computer and use it in GitHub Desktop.
#! /bin/bash
caskApps=$(ls /opt/homebrew-cask/Caskroom/) # Lists the casks in the Caskroom
apps=$(brew cask list);
for app in ${caskApps}; do # For every app there, do this
appToCheck=$(echo "${apps}" | grep "${app}") # If the app is not present in `brew cask list`, this variable will be empty
if [[ -z "${appToCheck}" ]]; then # If the variable is empty, then
echo "updating ${app}";
brew cask install --force "${app}" # Force an install of the app
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment