From 0c0561b98528d01faf0d7d6ab5a9324609284aaf Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Thu, 18 Oct 2018 16:29:48 +0200 Subject: :bug: Fix syntax, check function success with it's own if --- bin/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/install.sh b/bin/install.sh index 289f48e..08f160b 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -115,8 +115,10 @@ printf '%s\n' " - Running npm i..." tput sgr0 tput sc export NODE_ENV=production || { printf "\n\nInstall failed.\n"; exit 1; } -sudo runuser -l $username -c 'npm --prefix ~/install/src install ~/install/src --only=production || { printf "\n\nInstall failed.\n"; exit 1; }' # This is probably a bit overkill to have --only=... but better safe than sorry? -if [ $? -eq 0 ]; then +sudo runuser -l $username -c 'npm --prefix ~/install/src install ~/install/src --only=production' # This is probably a bit overkill to have --only=... but better safe than sorry? +if [ $? -ne 0 ]; then + printf "\n\nInstall failed.\n" + exit 1 fi tput rc; tput ed -- cgit v1.2.3