LookingGlass/doc/lgrelease.py
Jonathan Rubenstein 9ff476bd09 [doc] Minor cleanup to release spelling check
Co-authored-by: Guanzhong Chen <quantum2048@gmail.com>
2021-12-27 09:23:31 +11:00

16 lines
523 B
Python

# -- Path setup --------------------------------------------------------------
from pathlib import Path
try:
with open(Path(__file__).parent.parent / 'VERSION') as f:
release = f.read().strip()
except IOError:
import subprocess
try:
release = subprocess.check_output([
'git', 'describe', '--always', '--abbrev=10', '--dirty=+', '--tags'
]).decode('utf-8').strip()
except (subprocess.CalledProcessError, OSError):
release = '(unknown version)'
del subprocess