From 3f67de2ba4d99b0ba355f278e553a598db25d591 Mon Sep 17 00:00:00 2001 From: FlorianGareis Date: Fri, 1 Mar 2024 15:27:33 +0000 Subject: [PATCH] Also check for error after curl --- nodejs/run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodejs/run.sh b/nodejs/run.sh index b5fa5f9..8e6a53a 100755 --- a/nodejs/run.sh +++ b/nodejs/run.sh @@ -13,11 +13,17 @@ printf "$${BOLD}Installing nvm!$${RESET}\n" export NVM_DIR="$${INSTALL_PREFIX}/nvm" script="$(curl -sS -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$${NVM_VERSION}/install.sh" 2>&1)" +if [ $? -ne 0 ]; then + echo "Failed to download nvm installation script." + exit 1 +fi + output="$(bash <<<"$script" 2>&1)" if [ $? -ne 0 ]; then echo "Failed to install nvm: $output" exit 1 fi + printf "🥳 nvm has been installed\n\n" # Set up nvm for the rest of the script.