修复git_pull部分命令导致无法添加cron

This commit is contained in:
whyour 2021-03-29 11:40:30 +08:00
parent 306419158e
commit 02ed509a7f
2 changed files with 7 additions and 3 deletions

View File

@ -75,7 +75,7 @@ RUN cd ${QL_DIR} \
&& yarn build-back \
&& git clone -b ${QL_SCRIPTS_BRANCH} ${QL_SCRIPTS_URL} ${QL_DIR}/scripts \
&& cd ${QL_DIR}/scripts \
&& npm install \
&& npm install --no-save \
&& npm install -g pm2 \
&& rm -rf /root/.npm
ENTRYPOINT ["entrypoint"]

View File

@ -56,6 +56,8 @@ function Update_Cron {
function Git_PullShell {
echo -e "更新shell...\n"
cd ${ShellDir}
git config --global user.email "noreplay@githb.com"
git config --global user.name "noreplay"
git fetch --all
git stash
git pull
@ -89,6 +91,8 @@ function Git_PullScripts {
echo -e "更新scripts...\n"
cd ${ScriptsDir}
git fetch --all
git config --global user.email "noreplay@githb.com"
git config --global user.name "noreplay"
git rm -f --ignore-unmatch i-chenzhe*
git rm -f --ignore-unmatch moposmall*
git rm -f --ignore-unmatch qq34347476*
@ -152,10 +156,10 @@ function Notify_Version {
function Npm_InstallSub {
if [ -n "${isTermux}" ]
then
npm install --no-bin-links || npm install --no-bin-links --registry=https://registry.npm.taobao.org
npm install --no-bin-links --no-save || npm install --no-save --no-bin-links --registry=https://registry.npm.taobao.org
elif ! type yarn >/dev/null 2>&1
then
npm install || npm install --registry=https://registry.npm.taobao.org
npm install --no-save || npm install --no-save --registry=https://registry.npm.taobao.org
else
echo -e "检测到本机安装了 yarn使用 yarn 替代 npm...\n"
yarn install || yarn install --registry=https://registry.npm.taobao.org