From efb8142cc67e94ef6f8dc428c86b3c5117f24ca7 Mon Sep 17 00:00:00 2001 From: anonymous Date: Sun, 11 Apr 2021 19:18:47 +0800 Subject: [PATCH] dev --- shell/update.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shell/update.sh b/shell/update.sh index e637f3de..2b5350e7 100644 --- a/shell/update.sh +++ b/shell/update.sh @@ -136,10 +136,14 @@ detect_config_version () { ## npm install 子程序,判断是否为安卓,判断是否安装有yarn npm_install_sub () { - local cmd_1 cmd_2 - type yarn >/dev/null 2>&1 && cmd_1=yarn || cmd_1=npm - [[ $is_termux -eq 1 ]] && cmd_2="--no-bin-links" || cmd_2="" - $cmd_1 install $cmd_2 --registry=https://registry.npm.taobao.org || $cmd_1 install $cmd_2 + if [ $is_termux -eq 1 ]; then + npm install --production --no-save --no-bin-links --registry=https://registry.npm.taobao.org || npm install --production --no-bin-links --no-save + elif ! type yarn >/dev/null 2>&1; then + npm install --production --no-save --registry=https://registry.npm.taobao.org || npm install --production --no-save + else + echo -e "检测到本机安装了 yarn,使用 yarn 替代 npm...\n" + yarn install --production --network-timeout 1000000000 --registry=https://registry.npm.taobao.org || yarn install --production --network-timeout 1000000000 + fi } ## npm install,$1:package.json文件所在路径