Skip to content

Instantly share code, notes, and snippets.

@elexx
Last active December 29, 2015 23:59
Show Gist options
  • Save elexx/7746831 to your computer and use it in GitHub Desktop.
Save elexx/7746831 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
for app in $(brew cask list); do # For every app in the Caskroom, do this
appToCheck=$(brew cask list "${app}" 2>&1 >/dev/null | grep "${app} is not installed") # If the app is not marked as not installed `brew cask list "app"`, this variable will be "Warning: "app" is not installed",
if [[ ! -z "${appToCheck}" ]]; then # If the variable is empty, then
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