cdotfis-mac/dotfiles/.local/bin/upgradeCasks.sh

22 lines
774 B
Bash
Executable File

#!/bin/sh
if ! plutil -lint /Library/Preferences/com.apple.TimeMachine.plist > /dev/null ; then
echo "This script requires your terminal app to have Full Disk Access."
echo "Add this terminal to the Full Disk Access list or use Apple Terminal."
exit 1
fi
BREW_IGNORE_LIST=$(cat "$XDG_CACHE_HOME"/brew_ignore | tr '\n' '|' | sed 's/.$//' | sed 's/|/\\|/g')
if [ "$1" = "--dry-run" ]; then
if [ "$2" = "--all" ]; then
brew upgrade --dry-run --cask --greedy --force
# brew outdated --cask --greedy --verbose
else
brew upgrade --dry-run --cask --greedy --force $(brew list --cask | grep --invert-match --regexp $BREW_IGNORE_LIST)
fi
exit 0
fi
brew upgrade --cask --greedy --force $(brew list --cask | grep --invert-match --regexp $BREW_IGNORE_LIST)