Created
December 8, 2024 06:36
-
-
Save lotharschulz/b1252dd64aa6547e80c78d9290b91aa2 to your computer and use it in GitHub Desktop.
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 | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
set -euo pipefail | |
IFS=$'\n\t' | |
EXCLUDED_PACKAGES=("package1" "package2" "package3") | |
while [[ `brew list | wc -l` -ne 0 ]]; do | |
for EACH in `brew list`; do | |
if [[ ! " ${EXCLUDED_PACKAGES[@]} " =~ " ${EACH} " ]]; then | |
brew uninstall --force --ignore-dependencies $EACH | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment