mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Update Version.py to remove leading zero.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user