From 63ad13e09a641b6d5c7ac93fa60284beee6c6155 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 27 Jun 2022 20:46:01 +0200 Subject: [PATCH] Improved version handling of set-version --- tools/set_version/application.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/set_version/application.py b/tools/set_version/application.py index f052750e..a35e7f0a 100644 --- a/tools/set_version/application.py +++ b/tools/set_version/application.py @@ -55,9 +55,13 @@ class Application(ApplicationABC): return try: + version[VersionSettingsNameEnum.major.value] = branch.split('.')[0] version[VersionSettingsNameEnum.minor.value] = branch.split('.')[1] - version[VersionSettingsNameEnum.micro.value] = f'{branch.split(".")[2]}{suffix}' + if len(branch.split('.')) == 2: + version[VersionSettingsNameEnum.micro.value] = 0 + else: + version[VersionSettingsNameEnum.micro.value] = f'{branch.split(".")[2]}{suffix}' except Exception as e: Console.error(f'Branch {branch} does not contain valid version') return