Make hello loop through an array, make bye juste use git-summary

This commit is contained in:
flyingscorpio@arch-desktop 2020-10-27 12:43:24 +01:00
parent fc00e84474
commit 2be447b3c0

View file

@ -48,10 +48,14 @@ clitip() {
xmlstarlet unesc | fmt -80 | iconv -t US xmlstarlet unesc | fmt -80 | iconv -t US
} }
GIT_REPOS=(~/SetupCockpit ~/Keepass ~/Lessons/* ~/PersonalScripts ~/RootMe ~/SRC/*)
hello() { hello() {
start_dir="$PWD"
sudo protonvpn c -f sudo protonvpn c -f
echo echo
# Don't update if its a kernel update that will require reboot # Don't update if its a kernel update that will require reboot
if checkupdates; then
case "$(checkupdates)" in case "$(checkupdates)" in
*linux*) *linux*)
echo "Not performing update" echo "Not performing update"
@ -59,21 +63,16 @@ hello() {
*) *)
sudo pacman -Syu sudo pacman -Syu
esac esac
echo "Pulling from SetupCockpit" fi
cd ~/SetupCockpit && git pull
echo "Pulling from Keepass" for repo in "${GIT_REPOS[@]}"; do
cd ~/Keepass && git pull echo "Pulling from $repo..."
echo "Pulling from TSSR" cd "$repo" && git pull
cd ~/Lessons/TSSR && git pull done
cd || exit 1 cd "$start_dir" || exit 1
} }
bye() { 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 cd || exit 1
git-summary -d
} }