Created
August 23, 2024 19:30
-
-
Save shayelkin/9a5a0d5fb83cd0336ac190a9e7681757 to your computer and use it in GitHub Desktop.
Update all installed MacPorts packages
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/zsh | |
sudo port selfupdate | |
outdated_ports=$(port echo outdated) | |
if [[ -z $outdated_ports ]]; then | |
exit 0 | |
fi | |
echo "$outdated_ports \n---> Upgrade outdated ports? " | |
read -q | |
echo | |
if [[ $REPLY = "y" ]]; then | |
sudo port upgrade outdated | |
fi | |
inactive_ports=$(port echo inactive) | |
if [[ -z $inactive_ports ]]; then | |
exit 0 | |
fi | |
echo "$inactive_ports \n---> Remove inactive ports? " | |
read -q | |
echo | |
if [[ $REPLY = "y" ]]; then | |
sudo port uninstall inactive | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment