mirror of
https://github.com/C5H12O5/syno-videoinfo-plugin.git
synced 2025-07-25 17:10:47 +00:00
15 lines
412 B
Python
15 lines
412 B
Python
"""Version number management."""
|
|
import subprocess
|
|
|
|
__all__ = ["version"]
|
|
|
|
|
|
def version():
|
|
"""Extract the version number from git describe command."""
|
|
cmd = "git describe --tags --match v[0-9]*".split()
|
|
tag_describe = subprocess.check_output(cmd).decode().strip()
|
|
tag_version = tag_describe[1:]
|
|
if "-" in tag_version:
|
|
tag_version = tag_version.split("-", 1)[0]
|
|
return tag_version
|