Created
July 13, 2023 08:32
-
-
Save IOIO72/6fa9adbe684590d7ef7c27e0ec5b8743 to your computer and use it in GitHub Desktop.
Homebrew outdated casks greedy with excludes
This file contains 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
#!/bin/bash | |
# List of casks to exclude | |
excluded_casks=("autodesk-fusion360" "setapp") | |
# Get the list of outdated casks | |
outdated_casks=$(brew outdated --casks --greedy --quiet) | |
# Loop through the outdated casks and upgrade them, excluding the ones in the excluded_casks list | |
for cask in $outdated_casks; do | |
if [[ ! " ${excluded_casks[@]} " =~ " ${cask} " ]]; then | |
brew upgrade --cask $cask | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment