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

:bug: Fix version handling in plugins.py

parent c9ecc176
No related branches found
No related tags found
No related merge requests found
......@@ -810,9 +810,9 @@ def update_version(env: dict) -> None:
return
git_repo = git.Repo(search_parent_directories=True)
mike_version = list()
last_major = 0
last_minor = 0
last_patch = 0
last_major = -1
last_minor = -1
last_patch = -1
for i_tag in git_repo.tags:
i_tag = yaml.dump(i_tag.path)
i_tag = re.sub(".*v", "", i_tag).split(".")
......@@ -820,27 +820,29 @@ def update_version(env: dict) -> None:
minor = int(i_tag[1])
patch = int(i_tag[2])
if major > last_major:
mike_version.append(
{
"version": "{}.{}".format(last_major, last_minor),
"title": "{}.{}.{}".format(
last_major, last_minor, last_patch
),
"aliases": [],
}
)
if last_major >= 0:
mike_version.append(
{
"version": "{}.{}".format(last_major, last_minor),
"title": "{}.{}.{}".format(
last_major, last_minor, last_patch
),
"aliases": [],
}
)
last_major = major
last_minor = 0
last_minor = -1
if minor > last_minor:
mike_version.append(
{
"version": "{}.{}".format(last_major, last_minor),
"title": "{}.{}.{}".format(
last_major, last_minor, last_patch
),
"aliases": [],
}
)
if last_minor >= 0:
mike_version.append(
{
"version": "{}.{}".format(last_major, last_minor),
"title": "{}.{}.{}".format(
last_major, last_minor, last_patch
),
"aliases": [],
}
)
last_minor = minor
last_patch = 0
if patch > last_patch:
......
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