From 1ea5a7bcdd4c48a0d060d80dea0a828de547a181 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 26 Apr 2021 13:24:21 +0200 Subject: use commit from HEAD (reads branch name) --- api/status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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__) -- cgit v1.2.3