Avoid using regex at all
This commit is contained in:
parent
d7624defd7
commit
7213d84056
|
@ -1,7 +1,6 @@
|
|||
# MIT licensed
|
||||
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
|
||||
|
||||
import re
|
||||
from .cmd import run_cmd # type: ignore
|
||||
|
||||
async def get_version(
|
||||
|
@ -10,6 +9,5 @@ async def get_version(
|
|||
git = conf['git']
|
||||
cmd = f"git ls-remote -t --refs {git}"
|
||||
data = await cache.get(cmd, run_cmd)
|
||||
regex = "(?<=refs/tags/).*$"
|
||||
|
||||
return re.findall(regex, data, re.MULTILINE)
|
||||
versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
|
||||
return versions
|
||||
|
|
Loading…
Reference in New Issue