Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Feb 13, 2024
1 parent fc52df0 commit d374ac8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys

def increment_version(actual_version, fragment):
if '~' in actual_version:
if '-' in actual_version:
ver, pre = actual_version.split('-')
else:
ver = actual_version
Expand Down Expand Up @@ -48,6 +48,8 @@ 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)
3 changes: 2 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ bump "1.0.0"
bump "1.5.6"
bump "4.2.0~dev.0"
bump "1.0.0~dev.1"
bump "1.0.0-rc.1"
bump "1.0.0-rc.1"
bump "1.4.1-dev.0"

0 comments on commit d374ac8

Please sign in to comment.