This commit is contained in:
Luk Lu
2021-12-10 20:16:52 +08:00
parent fd5f401430
commit 900293da36
4 changed files with 27 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo "Usage: setup.sh [nodeVersion]"
echo "Usage: this-script.sh [nodeVersion]"
defaultVersion=16
@@ -8,7 +8,7 @@ if [ v$1 != v ]
then
nodeVersion=$1
else
read -p "Enter nodejs version (leave blank for default 16; 'nvm' for nvm) >> " nodeVersion
read -p "Enter nodejs version (leave blank for default $defaultVersion) >> " nodeVersion
if [ ! $nodeVersion ]
then
nodeVersion=$defaultVersion
@@ -16,16 +16,11 @@ else
fi
fi
if [ $nodeVersion == 'nvm' ]
then
echo "######## Installing nvm ############################"
else
sudo apt update
echo "######## Installing C++ build tools for Linux ########"
sudo apt install curl gcc g++ make python -y # Debian 11 has no python by default.
sudo apt update
echo "######## Installing C++ build tools for Linux ########"
sudo apt install curl gcc g++ make python -y # Debian 11 has no python by default.
echo "######## Installing nodejs v$nodeVersion ########"
echo From https://deb.nodesource.com/setup_$nodeVersion.x
curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y
echo "######## nodejs v$nodeVersion installed completely! ########"
fi
echo "######## Installing nodejs v$nodeVersion ########"
echo From https://deb.nodesource.com/setup_$nodeVersion.x
curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y
echo "######## nodejs v$nodeVersion installed completely! ########"