updatet regex pattern to support postfix

This commit is contained in:
mazzol_a
2025-04-23 17:09:06 +02:00
committed by Dhanya Thattil
parent 1286373894
commit f3be955763
4 changed files with 5 additions and 6 deletions

View File

@ -17,8 +17,8 @@ def get_version():
version = sys.argv[1]
# Validate that the version argument matches semantic versioning format (X.Y.Z)
if not re.match(r'^\d+\.\d+\.\d+$', version):
print("Error: Version argument must be in semantic versioning format (X.Y.Z)")
if not re.match(r'^\d+\.\d+\.\d+(?:[\-\.][\.\w\-]+)?+$', version):
print("Error: Version argument must be in semantic versioning format (X.Y.Z[./-][postfix])")
sys.exit(1)
return version