From d97b93d22019aac50fdf1998cbef3db5ef76bdfa Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 23 Nov 2020 12:12:24 +0800 Subject: [PATCH] [feature] export NPM_BIN for other script to use --- devel/nodejs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devel/nodejs.sh b/devel/nodejs.sh index 5a35e26..3a29a28 100755 --- a/devel/nodejs.sh +++ b/devel/nodejs.sh @@ -8,9 +8,12 @@ FILES_PATH=$PREFIX/nodejs NODE_BIN=$PREFIX/bin/node NODE_URL=https://nodejs.org/dist NODE_VERSION=v14.15.1 +NPM_BIN=npm if in_china; then NODE_URL=https://npm.taobao.org/mirrors/node + NPM_BIN=cnpm fi +export NPM_BIN log "Setting up nodejs" @@ -29,7 +32,7 @@ install() { VERSION=$1 ARCH=x86 if [ -x "$NODE_BIN" ] && [ "$("$NODE_BIN" --version)" = "$VERSION" ]; then - exit 0 + return fi case "$(uname -m)" in x86_64)