mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Improve version handling
This commit is contained in:
12
app/utils/version.py
Normal file
12
app/utils/version.py
Normal file
@ -0,0 +1,12 @@
|
||||
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"
|
Reference in New Issue
Block a user