Skip to content

Commit

Permalink
handling case that not have version name label
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-j0y authored and Kick-snare committed May 28, 2024
1 parent 38b6e24 commit 9a3f712
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/control_multi_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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) :
Expand Down

0 comments on commit 9a3f712

Please sign in to comment.