mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 00:16:06 +08:00
修改update对应分支
This commit is contained in:
parent
999d9f8e01
commit
ccd308f5b0
|
@ -316,15 +316,15 @@ git_pull_scripts() {
|
|||
local dir_current=$(pwd)
|
||||
local dir_work="$1"
|
||||
local branch="$2"
|
||||
[[ $branch ]] && git checkout ${branch}
|
||||
[[ $branch ]] && local part_cmd="origin/${branch}"
|
||||
cd $dir_work
|
||||
echo -e "开始更新仓库:$dir_work\n"
|
||||
|
||||
set_proxy
|
||||
git fetch --all
|
||||
exit_status=$?
|
||||
git reset --hard &>/dev/null
|
||||
git pull --allow-unrelated-histories &>/dev/null
|
||||
git reset --hard $part_cmd
|
||||
git pull
|
||||
unset_proxy
|
||||
|
||||
cd $dir_current
|
||||
|
|
|
@ -246,9 +246,10 @@ update_qinglong() {
|
|||
pnpm install -g pm2 &>/dev/null
|
||||
|
||||
local no_restart="$1"
|
||||
local primary_branch="master"
|
||||
[[ -f $dir_root/package.json ]] && ql_depend_old=$(cat $dir_root/package.json)
|
||||
reset_romote_url ${dir_root} "https://github.com/whyour/qinglong.git" ${current_branch}
|
||||
git_pull_scripts $dir_root ${current_branch}
|
||||
reset_romote_url ${dir_root} "https://github.com/whyour/qinglong.git" ${primary_branch}
|
||||
git_pull_scripts $dir_root ${primary_branch}
|
||||
|
||||
if [[ $exit_status -eq 0 ]]; then
|
||||
echo -e "\n更新$dir_root成功...\n"
|
||||
|
@ -264,8 +265,8 @@ update_qinglong() {
|
|||
|
||||
local url="https://github.com/whyour/qinglong-static.git"
|
||||
if [[ -d ${ql_static_repo}/.git ]]; then
|
||||
reset_romote_url ${ql_static_repo} ${url} ${current_branch}
|
||||
git_pull_scripts ${ql_static_repo} ${current_branch}
|
||||
reset_romote_url ${ql_static_repo} ${url} ${primary_branch}
|
||||
git_pull_scripts ${ql_static_repo} ${primary_branch}
|
||||
else
|
||||
git_clone_scripts ${url} ${ql_static_repo}
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user