nvchecker/nvchecker_source/git.py

14 lines
381 B
Python
Raw Normal View History

# MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
2020-09-23 20:51:28 +00:00
from .cmd import run_cmd # type: ignore
async def get_version(
name, conf, *, cache, keymanager=None
):
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
2020-09-23 21:45:09 +00:00
return versions