Skip to content

Instantly share code, notes, and snippets.

@RealityRipple
Created December 29, 2020 22:54
Show Gist options
  • Save RealityRipple/aee5688349599178f8dce9409ff0fd10 to your computer and use it in GitHub Desktop.
Save RealityRipple/aee5688349599178f8dce9409ff0fd10 to your computer and use it in GitHub Desktop.
Arch Linux AUR Auto-Update Script
#!/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