Created
August 7, 2025 21:44
-
-
Save felipealfonsog/fc706973220bf105b38889c4a09e1c16 to your computer and use it in GitHub Desktop.
Safe upgrade for each outdated package on brew (macOS)
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
#!/bin/bash | |
# Lista de paquetes desactualizados | |
outdated=$(brew outdated --formula | awk '{print $1}') | |
echo "Starting safe upgrade for each outdated package..." | |
for pkg in $outdated; do | |
echo "-----------------------------" | |
echo "Upgrading: $pkg" | |
echo "-----------------------------" | |
HOMEBREW_FORCE_BOTTLE=1 brew upgrade "$pkg" | |
if [ $? -ne 0 ]; then | |
echo "❌ Failed to upgrade: $pkg" | |
break | |
else | |
echo "✅ Successfully upgraded: $pkg" | |
fi | |
done | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment