use git log to print version

This commit is contained in:
Matthias 2019-09-09 20:18:47 +02:00
parent c38f3a2b9a
commit 85f1291597

View File

@ -5,8 +5,9 @@ if __version__ == 'develop':
try: try:
import subprocess import subprocess
__version__ = str(subprocess.check_output( __version__ = 'develop-' + subprocess.check_output(
["git", "describe"], stderr=subprocess.DEVNULL).rstrip()) ['git', 'log', '--format="%h"', '-n 1'],
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
except Exception: except Exception:
# git not available, ignore # git not available, ignore
pass pass