Skip to content

Commit 9534e2d

Browse files
committed
Fix issue #1
1 parent 47d17c4 commit 9534e2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gitver/commands.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def parse_templates(templates, repo, next_custom, promote):
7777
else:
7878
suffix = cfg['next_suffix']
7979

80-
# this should NEVER fail
8180
has_user_string = (promote or in_next) and not next_custom is None
8281
if has_user_string:
8382
user = user_numbers_from_string(next_custom)
@@ -88,8 +87,8 @@ def parse_templates(templates, repo, next_custom, promote):
8887

8988
keywords = {
9089
'CURRENT_VERSION': vstring,
91-
'BUILD_ID': repo['build-id'],
92-
'FULL_BUILD_ID': repo['full-build-id'],
90+
'BUILD_ID': repo['build-id'] if not promote else '',
91+
'FULL_BUILD_ID': repo['full-build-id'] if not promote else '',
9392
'MAJOR': repo['maj'] if not has_user_string else int(user[0]),
9493
'MINOR': repo['min'] if not has_user_string else int(user[1]),
9594
'PATCH': repo['patch'] if not has_user_string else int(user[2]),
@@ -131,11 +130,11 @@ def user_numbers_from_string(user):
131130
def build_version_string(repo, promote=False, next_custom=None):
132131
in_next = repo['count'] > 0
133132
has_next_custom = not next_custom is None and len(next_custom) > 0
133+
134134
if promote:
135135
if has_next_custom:
136136
# simulates next real version after proper tagging
137137
version = next_custom
138-
version += "/" + repo['build-id']
139138
return version
140139
else:
141140
return ''

0 commit comments

Comments
 (0)