Updated versionbump.py to include the new version in the error message and print the updated content when running in dry-run mode.

This commit is contained in:
Paul Gauthier 2023-06-17 07:24:11 -07:00
parent 2b1fab43a1
commit 1aa8699e15

View file

@ -20,12 +20,13 @@ def main():
current_version = re.search(r'__version__ = "(.+?)"', content).group(1)
if new_version <= version.parse(current_version):
raise ValueError("New version must be greater than the current version")
raise ValueError(f"New version {new_version} must be greater than the current version {current_version}")
updated_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}"', content)
if dry_run:
print("Updating aider/__init__.py with new version")
print("Updating aider/__init__.py with new version:")
print(updated_content)
else:
with open("aider/__init__.py", "w") as f:
f.write(updated_content)