Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd committed Oct 17, 2023
1 parent fdffbe6 commit 0ff0a87
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions s/update-version
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import re
import argparse
import tomlkit


def main():
parser = argparse.ArgumentParser()
parser.add_argument("version_increment", choices=["major", "minor", "patch"])
Expand All @@ -19,19 +20,17 @@ def main():

major, minor, patch = [int(x) for x in current_version.split(".")]


match args.version_increment:
case "major":
major += 1
minor = 0
patch = 0
case "minor":
minor += 1
patch = 0
case "patch":
patch += 1
case _:
raise ValueError("Unexpected value")
if args.version_increment == "major":
major += 1
minor = 0
patch = 0
elif args.version_increment == "minor":
minor += 1
patch = 0
elif args.version_increment == "patch":
patch += 1
else:
raise ValueError("Unexpected value")

new_version = f"{major}.{minor}.{patch}"

Expand Down

0 comments on commit 0ff0a87

Please sign in to comment.