Update Version.py to remove leading zero.

This commit is contained in:
ElectroJr
2023-06-18 13:43:32 -04:00
parent 33702b10f3
commit da860d4f56

View File

@@ -11,7 +11,7 @@ from typing import List
def main():
parser = argparse.ArgumentParser(description = "Tool for versioning RobustToolbox: commits the version config update and sets your local tag.")
parser.add_argument("version", help = "Version that will be written to tag. Format: 0.x.x.x")
parser.add_argument("version", help = "Version that will be written to tag. Format: x.x.x")
parser.add_argument("--file-only", action = "store_true", help = "Does not perform the Git part of the update (for writes only, not undos!)")
parser.add_argument("--undo", action = "store_true", help = "Macro to rebase over last commit and remove version tag. Version still required.")
@@ -29,15 +29,12 @@ def main():
def verify_version(version: str):
parts = version.split(".")
if len(parts) != 4:
print("Version must be split into four parts with '.'")
if len(parts) != 3:
print("Version must be split into three parts with '.'")
sys.exit(1)
for v in parts:
# this verifies parsability, exceptions here are expected for bad input
int(v)
if int(parts[0]) != 0:
print("Major version must be 0")
sys.exit(1)
def write_version(version: str, file_only: bool):
# Writing operation