Skip to content

Commit 40212d9

Browse files
author
142vip.cn
committed
fix: 修复sync脚本在next上同步异常
1 parent 320baae commit 40212d9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/sync

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ remoteList=("origin" "mmdapl" "chufan443" "lir0115")
1212
current_branch=$(git rev-parse --abbrev-ref HEAD)
1313

1414

15-
# 判断分支名称
15+
# master分支同步
1616
if [ "$current_branch" = "master" ]; then
1717

1818
# 合并next分支内容到master分之
@@ -21,9 +21,16 @@ if [ "$current_branch" = "master" ]; then
2121
# 推送到每个远程仓库
2222
for repoName in "${remoteList[@]}"
2323
do
24-
echo "Pushing to $repoName..."
24+
echo "-->Pushing to $repoName in master branch..."
2525
git push "$repoName" master
2626
done
27+
# next分支同步
28+
elif [ "$current_branch" = "next" ]; then
29+
for repoName in "${remoteList[@]}"
30+
do
31+
echo "-->Pushing to $repoName in next branch..."
32+
git push "$repoName" next
33+
done
2734
else
28-
echo "当前分支是:$current_branch只允许在master分支上操作,并推送到远程!!!"
35+
echo "当前分支是:$current_branch只允许在master和next分支上操作,并推送到远程!!!"
2936
fi

0 commit comments

Comments
 (0)