From dca343b022cccb287e8b94d453c434211443f1a0 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Tue, 31 Aug 2021 11:14:44 +0200 Subject: [PATCH] Add function aur_update --- dotfiles/shell/aliases | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dotfiles/shell/aliases b/dotfiles/shell/aliases index f739c51..faa9fcd 100644 --- a/dotfiles/shell/aliases +++ b/dotfiles/shell/aliases @@ -87,6 +87,27 @@ system_update() { fi } +aur_update() { + local start_dir="$PWD" + for repo in $(dirname $(find ~/builds -name .git -type d)); do + cd && cd "$repo" && git fetch -q + local unpulled=$(git log --pretty=format:'%h' ..@{u} | wc -c) + if [ "$unpulled" -eq 0 ]; then + echo "$(basename "$repo") is up to date" + else + git pull && git chlog -p + echo -n "Update $repo? [y/N] " + read -r answer + if [ ! "$answer" = 'y' ]; then + continue + else + makepkg -cirs + fi + fi + done + cd "$start_dir" || exit 1 +} + pull_from_repos() { local start_dir="$PWD" for repo in "${GIT_REPOS[@]}"; do