catch stderr when running git subprocess outside of a git repo.

This commit is contained in:
fiatjaf 2020-11-10 22:29:52 -03:00
parent 8f1ae1646e
commit 4456dd6f59

View File

@ -30,6 +30,13 @@ PREFER_SECURE_URLS = env.bool("LNBITS_FORCE_HTTPS", default=True)
SERVICE_FEE = env.float("LNBITS_SERVICE_FEE", default=0.0)
try:
LNBITS_COMMIT = subprocess.check_output(["git", "-C", LNBITS_PATH, "rev-parse", "HEAD"]).strip().decode("ascii")
LNBITS_COMMIT = (
subprocess.check_output(
["git", "-C", LNBITS_PATH, "rev-parse", "HEAD"],
stderr=subprocess.DEVNULL,
)
.strip()
.decode("ascii")
)
except:
LNBITS_COMMIT = "unknown"