Skip to content

Commit

Permalink
Use - instead of ~
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Feb 13, 2024
1 parent 487f9be commit fc52df0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def increment_version(actual_version, fragment):
if '~' in actual_version:
ver, pre = actual_version.split('~')
ver, pre = actual_version.split('-')
else:
ver = actual_version
pre = None
Expand All @@ -19,7 +19,7 @@ def increment_version(actual_version, fragment):
pre[1] = str(int(pre[1]) + 1)
pre = '.'.join(pre)

return f"{major}.{minor}.{patch}~{pre}"
return f"{major}.{minor}.{patch}-{pre}"

elif fragment == 'major':
return f"{int(major) + 1}.0.0"
Expand Down Expand Up @@ -48,8 +48,6 @@ def increment_version(actual_version, fragment):
#remove the v prefix if any
if actual_version.startswith('v'):
actual_version = actual_version[1:]

actual_version = actual_version.replace('-', '~')

new_version = increment_version(actual_version, fragment)
print(new_version)

0 comments on commit fc52df0

Please sign in to comment.