From 1f9251f66c76abb48fb7c0b6546b9ec2126d4bd6 Mon Sep 17 00:00:00 2001 From: Rohail Taimour Date: Tue, 15 Oct 2024 07:39:08 +0200 Subject: [PATCH] add fixes --- release.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/release.py b/release.py index 3c8659f..b0af468 100644 --- a/release.py +++ b/release.py @@ -4,7 +4,7 @@ def bump_version(bump_type): - subprocess.run(["bump2version", bump_type], check=True) + subprocess.run(["bump2version", "--new-version", bump_type], check=True) # Extract the new version from bump2version's output result = subprocess.run( @@ -55,11 +55,12 @@ def update_git(new_version: str, delete_existing_tag: bool = False): subprocess.run(["git", "fetch", "--tags"], check=True) tag_name = f"v{new_version}" - if tag_exists_on_remote(tag_name) and delete_existing_tag: - delete_tag(tag_name) - else: - print(f"Tag {tag_name} already exists on the remote. Aborting!") - sys.exit(1) + if tag_exists_on_remote(tag_name): + if delete_existing_tag: + delete_tag(tag_name) + else: + print(f"Tag {tag_name} already exists on the remote. Aborting!") + sys.exit(1) subprocess.run( ["git", "commit", "-am", f"Bump version to {new_version}"], check=True