mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
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:
parent
2b1fab43a1
commit
1aa8699e15
1 changed files with 3 additions and 2 deletions
|
@ -20,12 +20,13 @@ def main():
|
||||||
|
|
||||||
current_version = re.search(r'__version__ = "(.+?)"', content).group(1)
|
current_version = re.search(r'__version__ = "(.+?)"', content).group(1)
|
||||||
if new_version <= version.parse(current_version):
|
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)
|
updated_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}"', content)
|
||||||
|
|
||||||
if dry_run:
|
if dry_run:
|
||||||
print("Updating aider/__init__.py with new version")
|
print("Updating aider/__init__.py with new version:")
|
||||||
|
print(updated_content)
|
||||||
else:
|
else:
|
||||||
with open("aider/__init__.py", "w") as f:
|
with open("aider/__init__.py", "w") as f:
|
||||||
f.write(updated_content)
|
f.write(updated_content)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue