Browse Source

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

livestream
fiatjaf 4 years ago
parent
commit
4456dd6f59
  1. 9
      lnbits/settings.py

9
lnbits/settings.py

@ -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"

Loading…
Cancel
Save