Skip to content

Commit

Permalink
use regex to get version number
Browse files Browse the repository at this point in the history
Signed-off-by: ijnek <kenjibrameld@gmail.com>
  • Loading branch information
ijnek committed Feb 2, 2023
1 parent 57f13b1 commit b140708
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bloom/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import os
import functools
import re
import shutil
import subprocess
import tempfile
Expand Down Expand Up @@ -686,7 +687,8 @@ def get_last_tag_by_version(directory=None):
versions = []
for line in output.splitlines():
tags.append(line.strip())
versions.append(version.parse(line.lstrip('upstream/').strip()))
ver = re.match("[0-9]+.[0-9]+.[0-9]+", line)
versions.append(ver)
return tags[versions.index(max(versions))] if versions else ''


Expand Down

0 comments on commit b140708

Please sign in to comment.