mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 23:41:09 +00:00
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__':
|
||||
|
|
|
@ -2,6 +2,8 @@ import logging
|
|||
import subprocess
|
||||
import traceback
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from . import __version__, misc
|
||||
from .http_debug import STATS
|
||||
from .misc import Message, Response, WKNodeinfo
|
||||
|
@ -9,13 +11,16 @@ from .processors import run_processor
|
|||
|
||||
|
||||
routes = []
|
||||
version = __version__
|
||||
|
||||
try:
|
||||
commit_label = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode('ascii')
|
||||
version = f'{__version__} {commit_label}'
|
||||
|
||||
except:
|
||||
version = __version__
|
||||
if Path(__file__).parent.parent.joinpath('.git').exists():
|
||||
try:
|
||||
commit_label = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode('ascii')
|
||||
version = f'{__version__} {commit_label}'
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def register_route(method, path):
|
||||
|
|
Loading…
Reference in a new issue