Plan for lack of version

This commit is contained in:
Layla 2019-11-22 16:10:01 -05:00
parent b81338a849
commit 116961f1f7
2 changed files with 5 additions and 3 deletions

View File

@ -107,8 +107,10 @@ class SemVer(object):
current_config = re.search(pattern, config_file)
if current_config:
config_file.replace(current_config, "current_version = " + get_tag_version())
with open(".bumpversion.cfg", "w") as file:
file.write(config_file)
else:
config_file.replace("[bumpversion]","[bumpversion]\ncurrent_version = " + get_tag_version())
with open(".bumpversion.cfg", "w") as file:
file.write(config_file)
# version repo
p = subprocess.Popen(['bumpversion', self.version_type],

View File

@ -12,7 +12,7 @@ except ImportError:
DEVNULL = open(os.devnull, 'wb')
def get_tag_version():
version = "develop"
version = "0.0.0"
tagged_versions = subprocess.Popen(['git','tag','-l','[0-9]*.[0-9]*.[0-9]*'],
stdout=subprocess.PIPE, stderr=DEVNULL, cwd=".").stdout.read().decode('utf-8').rstrip().split('\n')