From 3b59e95c033afe342257083f8f362319af07e39c Mon Sep 17 00:00:00 2001 From: Derek DeJonghe Date: Thu, 13 May 2021 11:57:03 -0400 Subject: [PATCH] yarn does not like _ so we will cast to - --- semver/get_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semver/get_version.py b/semver/get_version.py index 68eeb6d..6c3e195 100644 --- a/semver/get_version.py +++ b/semver/get_version.py @@ -32,10 +32,10 @@ def get_version(build=0,version_format=None,dot=False): next_version = bump_version(get_tag_version(), version_type, False, False) if version_format in ('npm','docker'): - return "{}-{}.{}".format(next_version,branch.replace('/','-'),build) + return "{}-{}.{}".format(next_version,re.sub(r'[/_]', '-', branch),build) if version_format == 'maven': qualifier = 'SNAPSHOT' if build == 0 else build - return "{}-{}-{}".format(next_version,branch.replace('/','-'),qualifier) + return "{}-{}-{}".format(next_version,re.sub(r'[/_]', '-', branch),qualifier) if dot: branch = branch.replace('/','.') return branch