修改check命令,安装依赖使用代理

修改apk源地址
This commit is contained in:
whyour 2022-02-16 23:06:12 +08:00
parent 71b0c10997
commit 86df495b67
4 changed files with 6 additions and 14 deletions

View File

@ -10,7 +10,7 @@ ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
COPY package.json /
RUN set -x \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update -f \
&& apk upgrade \
&& apk --no-cache add -f bash \

View File

@ -10,13 +10,11 @@ reset_env() {
echo -e "---> 配置文件检测完成\n"
echo -e "---> 2. 开始安装青龙依赖\n"
rm -rf $dir_root/node_modules
npm_install_2 $dir_root
echo -e "---> 青龙依赖安装完成\n"
echo -e "---> 3. 开始安装脚本依赖\n"
cp -f $dir_sample/package.json $dir_scripts/package.json
rm -rf $dir_scripts/node_modules
npm_install_2 $dir_scripts
echo -e "---> 脚本依赖安装完成\n"
}
@ -50,8 +48,8 @@ pm2_log() {
echo -e "---> pm2日志"
local panelOut="/root/.pm2/logs/panel-out.log"
local panelError="/root/.pm2/logs/panel-error.log"
tail -n 20 "$panelOut"
tail -n 20 "$panelError"
tail -n 100 "$panelOut"
tail -n 100 "$panelError"
}
check_nginx() {

View File

@ -242,6 +242,7 @@ fix_config() {
}
npm_install_sub() {
set_proxy
if [ $is_termux -eq 1 ]; then
npm install --production --no-bin-links --registry=https://registry.npm.taobao.org || npm install --production --no-bin-links
elif ! type pnpm &>/dev/null; then
@ -249,6 +250,7 @@ npm_install_sub() {
else
pnpm install --production --registry=https://registry.npm.taobao.org || pnpm install --production
fi
unset_proxy
}
npm_install_1() {

View File

@ -157,20 +157,12 @@ update_repo() {
else
git_clone_scripts "${formatUrl}" ${repo_path} "${branch}"
fi
if [[ $exit_status -eq 0 ]]; then
echo -e "\n更新${repo_path}成功...\n"
diff_scripts "$repo_path" "$author" "$path" "$blackword" "$dependence"
else
echo -e "\n更新${repo_path}失败,重新下载全新仓库...\n"
rm -rf ${repo_path}
git_clone_scripts "${formatUrl}" ${repo_path} "${branch}"
if [[ $exit_status -eq 0 ]]; then
echo -e "\n更新${repo_path}成功...\n"
diff_scripts "$repo_path" "$author" "$path" "$blackword" "$dependence"
else
echo -e "\n更新${repo_path}失败,请检查网络...\n"
fi
fi
}
## 更新所有 raw 文件