From 2be447b3c09ff2d66247ca6f1d3a559088f22b7a Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Tue, 27 Oct 2020 12:43:24 +0100 Subject: [PATCH] Make hello loop through an array, make bye juste use git-summary --- dotfiles/shell/aliases | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/dotfiles/shell/aliases b/dotfiles/shell/aliases index 59bc715..70a500d 100644 --- a/dotfiles/shell/aliases +++ b/dotfiles/shell/aliases @@ -48,32 +48,31 @@ clitip() { xmlstarlet unesc | fmt -80 | iconv -t US } +GIT_REPOS=(~/SetupCockpit ~/Keepass ~/Lessons/* ~/PersonalScripts ~/RootMe ~/SRC/*) + hello() { + start_dir="$PWD" sudo protonvpn c -f echo # Don't update if its a kernel update that will require reboot - case "$(checkupdates)" in - *linux*) - echo "Not performing update" - ;; - *) - sudo pacman -Syu - esac - echo "Pulling from SetupCockpit" - cd ~/SetupCockpit && git pull - echo "Pulling from Keepass" - cd ~/Keepass && git pull - echo "Pulling from TSSR" - cd ~/Lessons/TSSR && git pull - cd || exit 1 + if checkupdates; then + case "$(checkupdates)" in + *linux*) + echo "Not performing update" + ;; + *) + sudo pacman -Syu + esac + fi + + for repo in "${GIT_REPOS[@]}"; do + echo "Pulling from $repo..." + cd "$repo" && git pull + done + cd "$start_dir" || exit 1 } bye() { - echo "Pushing to SetupCockpit" - cd ~/SetupCockpit && git push - echo "Pushing to Keepass" - cd ~/Keepass && git push - echo "Pushing to TSSR" - cd ~/Lessons/TSSR && git push cd || exit 1 + git-summary -d }