From 8e109c48243ddbf7db8f8bebf92e4f5828a28994 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Sun, 9 Feb 2020 11:31:12 +0200 Subject: [PATCH] Don't randomly install npm unless required --- deployment_scripts/deploy_linux.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/deployment_scripts/deploy_linux.sh b/deployment_scripts/deploy_linux.sh index 20b5e030a..085c30b3a 100755 --- a/deployment_scripts/deploy_linux.sh +++ b/deployment_scripts/deploy_linux.sh @@ -174,14 +174,16 @@ openssl req -new -key cc/server.key -out cc/server.csr -subj "/C=GB/ST=London/L= openssl x509 -req -days 366 -in cc/server.csr -signkey cc/server.key -out cc/server.crt # Update node -log_message "Installing nodejs" -# shellcheck disable=SC2086 -if exists curl; then - curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - -else - wget -q -O - https://deb.nodesource.com/setup_12.x | sudo -E bash - +if ! exists npm; then + log_message "Installing nodejs" + # shellcheck disable=SC2086 + if exists curl; then + curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - + else + wget -q -O - https://deb.nodesource.com/setup_12.x | sudo -E bash - + fi + sudo apt-get install -y nodejs fi -sudo apt-get install -y nodejs cd "$ISLAND_PATH/cc/ui" || handle_error npm install sass-loader node-sass webpack --save-dev