From f8353f68c12dd01fab2e355056dd2bac4362b22b Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Tue, 10 Aug 2021 10:29:03 -0300 Subject: [PATCH] Add error messages to quiet commands --- install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 4a3dfbe..1f35196 100755 --- a/install.sh +++ b/install.sh @@ -11,13 +11,19 @@ qpopd() { quiet() { local DUMMY + set +e DUMMY=$($@ 2>&1 > /dev/null) + if [ $? -ne 0 ]; then + echo "$DUMMY" + set -e + return 1 + fi + set -e } testif() { - set +e - quiet $@ - set -e + local DUMMY + DUMMY=$($@ 2>&1 > /dev/null) }