Created
December 29, 2020 22:54
-
-
Save RealityRipple/aee5688349599178f8dce9409ff0fd10 to your computer and use it in GitHub Desktop.
Arch Linux AUR Auto-Update Script
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/sh | |
for d in */; do | |
cd $d | |
git reset --hard &>/dev/null | |
git clean -xdf &>/dev/null | |
git fetch | |
UPSTREAM=${1:-'@{u}'} | |
LOCAL=$(git rev-parse @) | |
REMOTE=$(git rev-parse "$UPSTREAM") | |
if [ "$LOCAL" = "$REMOTE" ]; then | |
echo "$d is up to date" | |
else | |
echo "$d needs to be updated" | |
git pull | |
makepkg -si | |
fi | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment