Skip to content

Commit aa3c915

Browse files
committed
scripts -> utils. Read manifest.json and expose those values, instead of running git rev-parse
1 parent 159fa41 commit aa3c915

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

api.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_status():
4343
temp = "undefined"
4444

4545
uptime = subprocess.check_output(["uptime"]).decode('utf-8').replace('\n', '')
46-
internet_status = subprocess.check_output(["./scripts/check_conn.sh"]).decode('utf-8').replace('\n', '')
46+
internet_status = subprocess.check_output(["./utils/check_conn.sh"]).decode('utf-8').replace('\n', '')
4747
return {'internet_status': internet_status,
4848
'temp': temp,
4949
'uptime': uptime}
@@ -52,9 +52,12 @@ def get_status():
5252
def get_info():
5353
# [:-2] strips out '\n' (cat)
5454
try:
55-
backend_commit = subprocess.check_output(["git", "rev-parse", "HEAD"])[0:7].decode('utf-8')
55+
with open('manifest.json', 'r') as f:
56+
metadata = json.load(f)
57+
backend_commit = metadata["backendCommit"][0:7]
5658
except:
57-
backend_commit = 'undefined'
59+
backend_commit = "undefined"
60+
5861
try:
5962
coderbot_version = subprocess.check_output(["cat", "/etc/coderbot/version"]).decode('utf-8').replace('\n', '')
6063
except:
File renamed without changes.

0 commit comments

Comments
 (0)