microblog.pub/app/utils/version.py

13 lines
255 B
Python
Raw Normal View History

2022-08-24 09:02:20 +02:00
import subprocess
def get_version_commit() -> str:
try:
return (
subprocess.check_output(["git", "rev-parse", "--short=8", "v2"])
.split()[0]
.decode()
)
except Exception:
return "dev"