Merge pull request #10 from RightBrain-Networks/bugfix/re-match-to-string

change re.match object to string by grouping the findings together
This commit is contained in:
Derek DeJonghe 2019-11-25 13:21:29 -05:00 committed by GitHub
commit 76186cf543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,7 @@ class SemVer(object):
pattern = re.compile("current_version = [0-9.]*")
current_config = re.search(pattern, config_file)
if current_config:
config_file.replace(current_config, "current_version = " + get_tag_version())
config_file.replace(current_config.group(0), "current_version = " + get_tag_version())
else:
config_file.replace("[bumpversion]","[bumpversion]\ncurrent_version = " + get_tag_version())
with open(".bumpversion.cfg", "w") as file: