[feature] export NPM_BIN for other script to use

This commit is contained in:
Klesh Wong 2020-11-23 12:12:24 +08:00
parent 8e290a1a3b
commit d97b93d220

View File

@ -8,9 +8,12 @@ FILES_PATH=$PREFIX/nodejs
NODE_BIN=$PREFIX/bin/node NODE_BIN=$PREFIX/bin/node
NODE_URL=https://nodejs.org/dist NODE_URL=https://nodejs.org/dist
NODE_VERSION=v14.15.1 NODE_VERSION=v14.15.1
NPM_BIN=npm
if in_china; then if in_china; then
NODE_URL=https://npm.taobao.org/mirrors/node NODE_URL=https://npm.taobao.org/mirrors/node
NPM_BIN=cnpm
fi fi
export NPM_BIN
log "Setting up nodejs" log "Setting up nodejs"
@ -29,7 +32,7 @@ install() {
VERSION=$1 VERSION=$1
ARCH=x86 ARCH=x86
if [ -x "$NODE_BIN" ] && [ "$("$NODE_BIN" --version)" = "$VERSION" ]; then if [ -x "$NODE_BIN" ] && [ "$("$NODE_BIN" --version)" = "$VERSION" ]; then
exit 0 return
fi fi
case "$(uname -m)" in case "$(uname -m)" in
x86_64) x86_64)