Skip to content

Instantly share code, notes, and snippets.

@JettScythe
Created August 18, 2022 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JettScythe/24fdb5016e37bde3a7adbedbca681851 to your computer and use it in GitHub Desktop.
Save JettScythe/24fdb5016e37bde3a7adbedbca681851 to your computer and use it in GitHub Desktop.
bash script to go through all folders in my AUR dir and auto update
#!/bin/sh
my_aur_folder=$HOME/AUR
aur_folders=()
while IFS= read -r line; do
aur_folders+=( "$line" )
done< <(ls ~/AUR/)
for folder in "${aur_folders[@]}"
do
cd "$my_aur_folder/$folder"; printf "\n\nChecking the $folder repo "
update_status=$(git status|awk 'NR==2{print $1 $2 $3 $4 $5 $6}');
if [[ "$update_status"=="Yourbranchisuptodate" ]]; then
printf "\nNothing to do, next"
else
printf "\n$update_status"
git pull && makepkg -si
fi
done
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment