improve version printing when run from a checkout
This commit is contained in:
parent
c1e1e7b8cb
commit
f1e8bfb8a7
1 changed files with 11 additions and 3 deletions
|
@ -19,7 +19,17 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
VERSION = "2.0.9"
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(os.devnull, 'w') as devnull:
|
||||||
|
here = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
VERSION = subprocess.check_output(
|
||||||
|
'cd "%s" && git describe' % here,
|
||||||
|
stderr=devnull, shell=True).decode('utf-8')
|
||||||
|
except:
|
||||||
|
VERSION = "2.0.9"
|
||||||
|
|
||||||
BANNER = """
|
BANNER = """
|
||||||
.. . .x+=:. s
|
.. . .x+=:. s
|
||||||
|
@ -38,8 +48,6 @@ BANNER = """
|
||||||
DOT_CDIST = ".cdist"
|
DOT_CDIST = ".cdist"
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
"""Base exception class for this project"""
|
"""Base exception class for this project"""
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue