This commit is contained in:
陆柯 2022-05-28 09:02:26 +08:00
parent afebc98ef7
commit 624039664c
2 changed files with 12 additions and 8 deletions

0
ipfsgo-install.sh Normal file → Executable file
View File

View File

@ -4,23 +4,27 @@ echo "Usage: this-script.sh [nodeVersion]"
defaultVersion=16
if [ v$1 != v ]
if [ $1 ]
then
nodeVersion=$1
else
read -p "Enter nodejs version (leave blank for default $defaultVersion) >> " nodeVersion
read -p "Enter nodejs version (leave blank for default $defaultVersion) or 'tools' >> " nodeVersion
if [ ! $nodeVersion ]
then
nodeVersion=$defaultVersion
echo Use default nodejs version $nodeVersion
echo Use default nodejs version $defaultVersion
fi
fi
sudo apt update
if [ $nodeVersion != "tools" ]
then
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 C++ build tools for Linux ########"
sudo apt install wget 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! ########"