only fetch commit hash if in running from git repo
This commit is contained in:
parent
8fd712c849
commit
ef5d4bc579
|
@ -1,4 +1,4 @@
|
||||||
from .manage import main
|
from relay.manage import main
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -2,6 +2,8 @@ import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from . import __version__, misc
|
from . import __version__, misc
|
||||||
from .http_debug import STATS
|
from .http_debug import STATS
|
||||||
from .misc import Message, Response, WKNodeinfo
|
from .misc import Message, Response, WKNodeinfo
|
||||||
|
@ -9,13 +11,16 @@ from .processors import run_processor
|
||||||
|
|
||||||
|
|
||||||
routes = []
|
routes = []
|
||||||
|
version = __version__
|
||||||
|
|
||||||
|
|
||||||
|
if Path(__file__).parent.parent.joinpath('.git').exists():
|
||||||
try:
|
try:
|
||||||
commit_label = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode('ascii')
|
commit_label = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode('ascii')
|
||||||
version = f'{__version__} {commit_label}'
|
version = f'{__version__} {commit_label}'
|
||||||
|
|
||||||
except:
|
except:
|
||||||
version = __version__
|
pass
|
||||||
|
|
||||||
|
|
||||||
def register_route(method, path):
|
def register_route(method, path):
|
||||||
|
|
Loading…
Reference in a new issue