mirror of
https://github.com/lan-tianxiang/JS_TOOL.git
synced 2026-02-04 11:23:12 +08:00
更新于 07-14 23:30
This commit is contained in:
12
jd.sh
12
jd.sh
@@ -944,10 +944,16 @@ detect_config_version() {
|
||||
## npm install 子程序,判断是否为安卓,判断是否安装有yarn
|
||||
npm_install_sub() {
|
||||
local cmd_1 cmd_2
|
||||
type pnpm >/dev/null 2>&1 && cmd_1=pnpm || cmd_1=npm
|
||||
type yarn >/dev/null 2>&1 && cmd_1=yarn || cmd_1=npm
|
||||
if [[ $(type pnpm) ]] >/dev/null 2>&1; then
|
||||
cmd_1=pnpm
|
||||
elif [[ $(type yarn) ]] >/dev/null 2>&1; then
|
||||
cmd_1=yarn
|
||||
else
|
||||
cmd_1=npm
|
||||
fi
|
||||
|
||||
[[ $SYSTEM = Android ]] && cmd_2="--no-bin-links" || cmd_2=""
|
||||
$cmd_1 install $cmd_2 --registry=https://registry.npm.taobao.org || $cmd_1 install $cmd_2
|
||||
$cmd_1 install $cmd_2
|
||||
}
|
||||
|
||||
## npm install,$1:package.json文件所在路径
|
||||
|
||||
Reference in New Issue
Block a user