Skip to content

Commit 5f09bcd

Browse files
committed
fix(bump): handle commit and create tag failure
1 parent 38f5a7c commit 5f09bcd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

commitizen/commands/bump.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
NO_COMMITS_FOUND = 3
88
NO_VERSION_SPECIFIED = 4
99
NO_PATTERN_MAP = 7
10+
COMMIT_FAILED = 8
11+
TAG_FAILED = 9
1012

1113

1214
class Bump:
@@ -114,6 +116,12 @@ def __call__(self):
114116

115117
config.set_key("version", new_version.public)
116118
bump.update_version_in_files(current_version, new_version.public, files)
117-
git.commit(message, args="-a")
118-
git.tag(new_tag_version)
119+
c = git.commit(message, args="-a")
120+
if c.err:
121+
out.error(c.err)
122+
raise SystemExit(COMMIT_FAILED)
123+
c = git.tag(new_tag_version)
124+
if c.err:
125+
out.error(c.err)
126+
raise SystemExit(TAG_FAILED)
119127
out.success("Done!")

0 commit comments

Comments
 (0)