diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-04-26 13:24:21 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-04-26 13:24:21 +0200 |
commit | 1ea5a7bcdd4c48a0d060d80dea0a828de547a181 (patch) | |
tree | 132904cde95c2f8d1a6411e7f5e8e7e7668a326b | |
parent | 6f0d4d8afe376b7e109d5c531c21b5626fe76b03 (diff) |
use commit from HEAD (reads branch name)
-rw-r--r-- | api/status.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api/status.py b/api/status.py index a609d42..c8597f4 100644 --- a/api/status.py +++ b/api/status.py @@ -2,9 +2,11 @@ from flask import Blueprint from db import cursor import json +HEAD = open(".git/HEAD", "r").read().split(" ")[1].strip() + version = { "number": json.loads(open("package.json", "r").read())["version"], - "commit": open(".git/refs/heads/master", "r").read().strip() + "commit": open(".git/" + HEAD, "r").read().strip() } status = Blueprint('server_status', __name__) |