Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 693e804

Browse files
fix(bump): Support regexes containing colons
The version_files feature uses a colon to delimit filenames from a regex to use to find the version. Make version_files slightly more robust by splitting on the first colon rather than all colons, thereby permitting the regex to contain a colon. Maintain the pre-existing assumption that the filename doesn't contain a colon, as this is rare and would likely cause many other problems.
1 parent 2110a14 commit 693e804

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎commitizen/bump.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def update_version_in_files(
141141
"""
142142
# TODO: separate check step and write step
143143
for location in files:
144-
filepath, *regexes = location.split(":")
145-
regex = regexes[0] if regexes else None
144+
filepath, _, regex = location.partition(":")
146145

147146
with open(filepath, "r") as f:
148147
version_file = f.read()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /