From e8652f350acb9f6db237592c1a901851cd68604f Mon Sep 17 00:00:00 2001 From: YooJun Hong <46425142+Kick-snare@users.noreply.github.com> Date: Tue, 28 May 2024 17:53:46 +0900 Subject: [PATCH] handling case that not have version name label (#6) Co-authored-by: Seungmin <39687846+peter-j0y@users.noreply.github.com> --- src/control_multi_version.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/control_multi_version.py b/src/control_multi_version.py index a501ed3..4d1bb6b 100644 --- a/src/control_multi_version.py +++ b/src/control_multi_version.py @@ -7,6 +7,7 @@ class VersionCategory(Enum): PATCH = auto() MINOR = auto() MAJOR = auto() + NONE = auto() # version_name 읽는 함수 def read_gradle_version_name(gradle_file_path, variable_name): @@ -85,10 +86,14 @@ def update_version(arg, label_list): version_code = int(arg['version_code']) major_version, minor_version, patch_version, revision_version = map(int, arg['version_name'].split('.')) + isBumpLabelNotExist = True for version_type in list(VersionCategory): if f'bump-{version_type.name.lower()}' in label_list: + isBumpLabelExist = false bump_version(version_type, arg['version_code_variable_name'], arg['version_name_variable_name'], version_code, major_version, minor_version, patch_version, revision_version) + if isBumpLabelNotExist: + bump_version(VersionCategory.NONE , arg['version_code_variable_name'], arg['version_name_variable_name'], version_code, major_version, minor_version, patch_version, revision_version) # 버전 올리는 함수 def bump_version(version_category, vc_variable_name, vn_variable_name, version_code, major_version, minor_version, patch_version, revision_version) :