Skip to content
Snippets Groups Projects
Verified Commit f1f1fdbf authored by Romain Deville's avatar Romain Deville
Browse files

:sparkles: Improve patch management in plugins.py

parent 33c099c0
No related branches found
No related tags found
No related merge requests found
...@@ -826,13 +826,20 @@ def update_version(env: dict) -> None: ...@@ -826,13 +826,20 @@ def update_version(env: dict) -> None:
mike_version = list() mike_version = list()
last_major = -1 last_major = -1
last_minor = -1 last_minor = -1
last_patch = -1 last_patch = str(-1)
for i_tag in git_repo.tags: for i_tag in git_repo.tags:
i_tag = yaml.dump(i_tag.path) i_tag = yaml.dump(i_tag.path)
i_tag = re.sub(".*v", "", i_tag).split(".") i_tag = re.sub(".*v", "", i_tag).split(".")
major = int(i_tag[0]) major = int(i_tag[0])
minor = int(i_tag[1]) minor = int(i_tag[1])
patch = int(i_tag[2]) patch = str()
for i_remain_tag in i_tag[2:]:
if i_remain_tag and i_remain_tag not in ("","\n"):
i_remain_tag = i_remain_tag.replace("\n","")
if not patch:
patch = f"{i_remain_tag}"
else:
patch = f"{patch}.{i_remain_tag}"
if major > last_major: if major > last_major:
if last_major >= 0: if last_major >= 0:
mike_version.append( mike_version.append(
...@@ -854,9 +861,10 @@ def update_version(env: dict) -> None: ...@@ -854,9 +861,10 @@ def update_version(env: dict) -> None:
} }
) )
last_minor = minor last_minor = minor
last_patch = -1 last_patch = str(-1)
if patch > last_patch: if patch > last_patch:
last_patch = patch last_patch = str(patch)
mike_version.append( mike_version.append(
{ {
"version": f"{last_major}.{last_minor}", "version": f"{last_major}.{last_minor}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment