Skip to content

Commit 569cb42

Browse files
committed
fix(gitutils): 🐛 improve error handling for version & CHANGELOG commit
1 parent 11f0ad3 commit 569cb42

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/gitutils/_git-release-prod.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ GIT_EDITOR=:
4545
GBV=$(bump-changelog -b -m)
4646
if [ "$?" -eq 0 ] && [ -n "$GBV" ]; then
4747
zz_log s "Version & CHANGELOG updated to: {B $GBV}"
48-
git commit -am "chore(release): $GBV"
48+
49+
if ! git commit -am "chore(release): $GBV"; then
50+
zz_log e "Cannot commit version & CHANGELOG"
51+
exit 1
52+
fi
53+
4954
if git flow $flow finish $name --push; then
5055
zz_log s "Release finished: {B $GBV}"
5156
rm -f .git/RELEASE
5257
else
53-
git undo
5458
zz_log e "Cannot finish release. CHANGELOG & VERSION are not updated."
5559
fi
5660
else

0 commit comments

Comments
 (0)