fix: check node error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-06-20 15:49:38 +08:00
parent 8252bfb856
commit 0b7faeccad

View File

@ -1,5 +1,4 @@
ROOT=$(pwd) ROOT=$(pwd)
NODE=$(which node)
clear clear
set -e set -e
echo "==============================" echo "=============================="
@ -17,7 +16,7 @@ echo $(date +%s) > .lock
echo "程序将在 3秒 后运行... Ctrl + C 取消运行..." echo "程序将在 3秒 后运行... Ctrl + C 取消运行..."
sleep 2 sleep 2
echo "开始检测安装依赖..." echo "开始检测安装依赖..."
if [[ -z "${NODE}" ]]; then if [[ -z "$(which node)" ]]; then
if [[ ! -d node ]]; then if [[ ! -d node ]]; then
echo "未安装NodeJS 开始下载二进制包 请稍候..." echo "未安装NodeJS 开始下载二进制包 请稍候..."
curl -o node.zip https://nodejs.org/dist/v10.16.0/node-v10.16.0-win-x64.zip curl -o node.zip https://nodejs.org/dist/v10.16.0/node-v10.16.0-win-x64.zip
@ -33,6 +32,9 @@ if [[ -z "${NODE}" ]]; then
read read
exit 1 exit 1
fi fi
else
NODE=node
NPM=npm
fi fi
echo "NodeJS 二进制版本: $(${NODE} -v)" echo "NodeJS 二进制版本: $(${NODE} -v)"
if [[ ! -d tera ]]; then if [[ ! -d tera ]]; then