Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit f5b05b0

Browse files
committed
fix: guard use of tag agains single command
1 parent 09ec292 commit f5b05b0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sbin/changelog.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ def changelog_part(commitish_to: str, commitish_from: str, version: str):
144144
]
145145
).split()
146146

147-
if args.tag is None:
148-
try:
149-
args.tag = tags[0]
150-
except:
151-
print(f"Error: no tags found!")
147+
if args.type == "single":
148+
if args.tag is None:
149+
try:
150+
args.tag = tags[0]
151+
except:
152+
print(f"Error: no tags found!")
153+
sys.exit(1)
154+
if args.tag not in tags:
155+
print(f"Error: tag {args.tag} not found!")
152156
sys.exit(1)
153157

154-
if args.type == "single" and args.tag not in tags:
155-
print(f"Error: tag {args.tag} not found!")
156-
sys.exit(1)
157-
158158
if args.type == "full" and args.release is not None:
159159
tags.insert(0, "HEAD")
160160

0 commit comments

Comments
 (0)