Skip to content

Commit

Permalink
create VersionConfig for a file just once
Browse files Browse the repository at this point in the history
  • Loading branch information
balrok authored and Carl Mai committed Jul 21, 2020
1 parent d737658 commit 78780b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bumpversion/cli.py
Expand Up @@ -353,11 +353,13 @@ def _load_configuration(config_file, explicit_config, defaults):

if "replace" not in section_config:
section_config["replace"] = defaults.get("replace", "{new_version}")

version_config = VersionConfig(**section_config)
if section_type.get("file") == "glob":
for filename_glob in glob.glob(filename):
files.append(ConfiguredFile(filename_glob, VersionConfig(**section_config)))
files.append(ConfiguredFile(filename_glob, version_config))
else:
files.append(ConfiguredFile(filename, VersionConfig(**section_config)))
files.append(ConfiguredFile(filename, version_config))
return config, config_file_exists, config_newlines, part_configs, files


Expand Down

0 comments on commit 78780b4

Please sign in to comment.