Last active
November 30, 2017 15:30
-
-
Save toonetown/657606a8bac754eb2856f53e5001b4a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Adds "upgrade" to `brew cask`. Accepts "--greedy" as an option. Just delegates to "reinstall" | |
# | |
#!/bin/bash | |
set -o pipefail | |
source /etc/profile | |
GREEDY="" | |
if [ "${1}" == "--greedy" ]; then GREEDY="${1}"; shift; fi | |
if [ $# -eq 0 ]; then | |
ARGS=($(brew cask outdated ${GREEDY} --verbose | grep -v '(latest)' | cut -d' ' -f1)) | |
else | |
ARGS=("$@") | |
fi | |
if [ ${#ARGS[@]} -gt 0 ]; then | |
echo "Upgrading casks ${ARGS[@]}..." | |
brew cask reinstall "${ARGS[@]}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment