mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Display git version in commit
This commit is contained in:
parent
e04eb44a15
commit
b7e5c08fdf
@ -24,4 +24,16 @@
|
||||
# number has been incremented)
|
||||
|
||||
__version__ = "2.0.0dev8"
|
||||
|
||||
# If it's a git checkout try to add the commit
|
||||
if "dev" in __version__:
|
||||
try:
|
||||
import os
|
||||
import subprocess
|
||||
if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".git")):
|
||||
r = subprocess.run(["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE).stdout.decode().strip("\n")
|
||||
__version__ += "-" + r
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
__version_info__ = (2, 0, 0, -99)
|
||||
|
Loading…
Reference in New Issue
Block a user