mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
print even when dry_run
This commit is contained in:
parent
cace9675b0
commit
86a418d899
1 changed files with 16 additions and 19 deletions
|
@ -23,7 +23,7 @@ def main():
|
||||||
with open("aider/__init__.py", "r") as f:
|
with open("aider/__init__.py", "r") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
||||||
current_version = re.search(r'__version__ = "(.+?)"', content).group(1).split('-dev')[0]
|
current_version = re.search(r'__version__ = "(.+?)"', content).group(1).split("-dev")[0]
|
||||||
if new_version <= version.parse(current_version):
|
if new_version <= version.parse(current_version):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"New version {new_version} must be greater than the current version {current_version}"
|
f"New version {new_version} must be greater than the current version {current_version}"
|
||||||
|
@ -31,10 +31,9 @@ def main():
|
||||||
|
|
||||||
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:
|
print("Updating aider/__init__.py with new version:")
|
||||||
print("Updating aider/__init__.py with new version:")
|
print(updated_content)
|
||||||
print(updated_content)
|
if not dry_run:
|
||||||
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)
|
||||||
|
|
||||||
|
@ -47,17 +46,17 @@ def main():
|
||||||
]
|
]
|
||||||
|
|
||||||
for cmd in git_commands:
|
for cmd in git_commands:
|
||||||
if dry_run:
|
print(f"Running: {' '.join(cmd)}")
|
||||||
print(f"Running: {' '.join(cmd)}")
|
if not dry_run:
|
||||||
else:
|
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
updated_dev_content = re.sub(r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content)
|
updated_dev_content = re.sub(
|
||||||
|
r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content
|
||||||
|
)
|
||||||
|
|
||||||
if dry_run:
|
print("Updating aider/__init__.py with new dev version:")
|
||||||
print("Updating aider/__init__.py with new dev version:")
|
print(updated_dev_content)
|
||||||
print(updated_dev_content)
|
if not dry_run:
|
||||||
else:
|
|
||||||
with open("aider/__init__.py", "w") as f:
|
with open("aider/__init__.py", "w") as f:
|
||||||
f.write(updated_dev_content)
|
f.write(updated_dev_content)
|
||||||
|
|
||||||
|
@ -68,15 +67,13 @@ def main():
|
||||||
]
|
]
|
||||||
|
|
||||||
for cmd in git_commands_dev:
|
for cmd in git_commands_dev:
|
||||||
if dry_run:
|
print(f"Running: {' '.join(cmd)}")
|
||||||
print(f"Running: {' '.join(cmd)}")
|
if not dry_run:
|
||||||
else:
|
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
for cmd in git_commands:
|
for cmd in git_commands:
|
||||||
if dry_run:
|
print(f"Running: {' '.join(cmd)}")
|
||||||
print(f"Running: {' '.join(cmd)}")
|
if not dry_run:
|
||||||
else:
|
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue