Don't randomly install npm unless required

This commit is contained in:
Daniel Goldberg 2020-02-09 11:31:12 +02:00
parent 6429bb5597
commit 8e109c4824
1 changed files with 9 additions and 7 deletions

View File

@ -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