Skip to content

Commit

Permalink
feat: exit when failed in rebase-all script
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiYou-TW committed Feb 29, 2024
1 parent 17a5c58 commit 3f148f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/rebase-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ for branch in $(git branch -r | grep -v HEAD); do

if [[ "$branch" != "main" ]]; then
git checkout "$branch"
if [[ $? -ne 0 ]]; then
echo "Checkout failed for branch $branch"
exit 1
fi
git pull origin "$branch"
if [[ $? -ne 0 ]]; then
echo "Pull failed for branch $branch"
exit 1
fi
git rebase main
if [[ $? -ne 0 ]]; then
echo "Rebase failed for branch $branch"
exit 1
fi
git push origin "$branch"
fi
done
Expand Down

0 comments on commit 3f148f9

Please sign in to comment.