From ddb6631d2a305aa45e40971a3735a1cab8213511 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 28 Nov 2024 11:45:26 +0100 Subject: [PATCH] chore(common): improve offline builds `nvm install` will fail if trying to build while offline. This change tries to use the required node version first and if that fails installs and then uses it. --- resources/build/_builder_nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/build/_builder_nvm.sh b/resources/build/_builder_nvm.sh index cccbb6b0556..a1bb9a4cc1b 100755 --- a/resources/build/_builder_nvm.sh +++ b/resources/build/_builder_nvm.sh @@ -41,8 +41,8 @@ type -t nvm >/dev/null || { } } -nvm install "$REQUIRED_NODE_VERSION" -nvm use "$REQUIRED_NODE_VERSION" +nvm use "$REQUIRED_NODE_VERSION" || \ + (nvm install "$REQUIRED_NODE_VERSION" && nvm use "$REQUIRED_NODE_VERSION") # Beware the hardcoded path below -- it should already be in the system PATH