From b7b536755cb197909eaea9d55c68cbe567e54448 Mon Sep 17 00:00:00 2001 From: b1ek Date: Wed, 14 Feb 2024 10:31:36 +1000 Subject: [PATCH] (feat) redirect pacman output and stop the build if pacman failed --- brick.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/brick.sh b/brick.sh index 43c6d82..fa6ab8d 100755 --- a/brick.sh +++ b/brick.sh @@ -167,7 +167,13 @@ if [ "${#PACDEPS[@]}" != "0" ]; then inf "$TO_INSTALL" # welp lets install those - sudo pacman -S --needed --noconfirm $TO_INSTALL + sudo pacman -S --needed --noconfirm $TO_INSTALL &> $BRICKS_DB/.pacman-log + PACCODE="$?" + if ! [ "$PACCODE" == "0" ]; then + err "pacman exited with code $PACCODE" + err "pacman's output log is in $BRICKS_DB/.pacman-log" + exit + fi inf "installed all pacman deps" else inf "no pacman deps to install"