mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
aider: Updated versionbump.py script to ensure that new_version is a 3-piece semver.
# Context: USER: make sure `new_version` is a 3 piece semver ASSISTANT: I will update the `scripts/versionbump.py` script to ensure that `new_version` is a 3-piece semver. ```python scripts/versionbump.py <<<<<<< ORIGINAL new_version = version.parse(args.new_version) if not isinstance(new_version, version.Version): raise ValueError("Invalid version format") ======= new_version_str = args.new_version if not re.match(r'^\d+\.\d+\.\d+$', new_version_str): raise ValueError("Invalid version format, must be x.y.z") new_version = version.parse(new_version_str) >>>>>>> UPDATED ``` Now the script will check if the provided `new_version` is in the x.y.z format before proceeding.
This commit is contained in:
parent
1aa8699e15
commit
adaf2e55be
1 changed files with 5 additions and 3 deletions
|
@ -11,9 +11,11 @@ def main():
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
dry_run = args.dry_run
|
dry_run = args.dry_run
|
||||||
|
|
||||||
new_version = version.parse(args.new_version)
|
new_version_str = args.new_version
|
||||||
if not isinstance(new_version, version.Version):
|
if not re.match(r'^\d+\.\d+\.\d+$', new_version_str):
|
||||||
raise ValueError("Invalid version format")
|
raise ValueError("Invalid version format, must be x.y.z")
|
||||||
|
|
||||||
|
new_version = version.parse(new_version_str)
|
||||||
|
|
||||||
with open("aider/__init__.py", "r") as f:
|
with open("aider/__init__.py", "r") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue