Initial release: DictIA v0.8.14-alpha (fork de Speakr, AGPL-3.0)
This commit is contained in:
29
src/config/version.py
Normal file
29
src/config/version.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
Version information helper.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
|
||||
|
||||
def get_version():
|
||||
# Try reading VERSION file first (works in Docker)
|
||||
try:
|
||||
with open('VERSION', 'r') as f:
|
||||
return f.read().strip()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
# Fall back to git tags (works in development)
|
||||
try:
|
||||
import subprocess
|
||||
return subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0'],
|
||||
stderr=subprocess.DEVNULL).decode().strip()
|
||||
except:
|
||||
pass
|
||||
|
||||
# Final fallback
|
||||
return "unknown"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user