From 00a0ebe0f8f44acea2294e22685c6368b66dfd4f Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Wed, 21 Apr 2021 18:23:10 -0300 Subject: [PATCH] update.sh: stop running if error when updating/cleaning --- Pacman/updateRepositories.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Pacman/updateRepositories.sh b/Pacman/updateRepositories.sh index 3cbe4f7..22229ab 100755 --- a/Pacman/updateRepositories.sh +++ b/Pacman/updateRepositories.sh @@ -14,15 +14,18 @@ bold "Pacman-mirrors -c" s "pacman-mirrors -c Brazil" 2>/dev/null s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" 2>/dev/null +# From now on, exit when any command fails +set -e + s -v bold "Updating..." yay -Syu --sudoloop --noconfirm --nobatchinstall --cleanafter bold "Cleaning stuff..." s -v -yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always 2>/dev/null) -s -v yay -Sc --noconfirm 2>/dev/null +s -v +yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always 2>/dev/null) s -k notify-send "Update script has finished!"