Skip to content

Instantly share code, notes, and snippets.

@IOIO72
Created July 13, 2023 08:32
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 IOIO72/6fa9adbe684590d7ef7c27e0ec5b8743 to your computer and use it in GitHub Desktop.
Save IOIO72/6fa9adbe684590d7ef7c27e0ec5b8743 to your computer and use it in GitHub Desktop.
Homebrew outdated casks greedy with excludes
#!/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