From 1d3ac7bcb6ab312d291241e1a7475da88a0e9104 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Mon, 4 May 2020 15:36:42 +0800 Subject: [PATCH] u --- adjust-mac-launchpad.sh => config-mac.sh | 0 git-pull-all.sh | 6 +++--- install-node-by-nvm.sh | 14 ------------- install-node.sh | 25 ++++++++++++++---------- 4 files changed, 18 insertions(+), 27 deletions(-) rename adjust-mac-launchpad.sh => config-mac.sh (100%) delete mode 100755 install-node-by-nvm.sh diff --git a/adjust-mac-launchpad.sh b/config-mac.sh similarity index 100% rename from adjust-mac-launchpad.sh rename to config-mac.sh diff --git a/git-pull-all.sh b/git-pull-all.sh index c0821ab..467831f 100755 --- a/git-pull-all.sh +++ b/git-pull-all.sh @@ -4,11 +4,11 @@ if [ $1 ] then FONPATH=$1 else - read -p "Enter path-to-faronear (leave blank for default /faronear) >> " FONPATH + read -p "Enter path to pull (leave blank for default ./) >> " FONPATH if [ ! $FONPATH ] then - echo Use default path: /faronear - FONPATH=/faronear + echo Use default path: ./ + FONPATH=./ fi fi diff --git a/install-node-by-nvm.sh b/install-node-by-nvm.sh deleted file mode 100755 index 850186e..0000000 --- a/install-node-by-nvm.sh +++ /dev/null @@ -1,14 +0,0 @@ -apt install curl -y - -echo "######## 安装 nvm ############################" -curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash - -echo "######## 启用 nvm ############################" -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - -echo "######## 安装最新版 node #####################" -nvm install node - -echo "######## node/npm 安装完毕!##################" diff --git a/install-node.sh b/install-node.sh index 7031dc8..fe8f7c0 100755 --- a/install-node.sh +++ b/install-node.sh @@ -1,24 +1,29 @@ #!/bin/bash echo "Usage: setup.sh [nodeVersion]" -echo "Example: setup.sh 12" +echo "Example: setup.sh 14" if [ v$1 != v ] then nodeVersion=$1 else - read -p "Enter node version (leave blank for default 12) >> " nodeVersion + read -p "Enter node version (leave blank for default 14; 'nvm' for nvm) >> " nodeVersion if [ ! $nodeVersion ] then - echo Use default node version 12 - nodeVersion=12 + echo Use default node version 14 + nodeVersion=14 fi fi -sudo apt update -sudo apt install curl gcc g++ make -y +if [ $nodeVersion == 'nvm' ] +then + echo "######## 安装 nvm ############################" +else + sudo apt update + sudo apt install curl gcc g++ make -y -echo "######## 安装 node v$nodeVersion ##################" -echo https://deb.nodesource.com/setup_$nodeVersion.x -curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y -echo "######## node v$nodeVersion 安装完毕!##################" + echo "######## 安装 node v$nodeVersion ##################" + echo https://deb.nodesource.com/setup_$nodeVersion.x + curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y + echo "######## node v$nodeVersion 安装完毕!##################" +fi