8000 update build_board_info.py per Neradoc · vickash/circuitpython@60e7df1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60e7df1

Browse files
committed
update build_board_info.py per Neradoc
1 parent bd88992 commit 60e7df1

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tools/build_board_info.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import json
88
import os
9+
import requests
910
import subprocess
1011
import sys
1112
import sh
@@ -96,7 +97,19 @@ def get_current_info():
9697
response = response.json()
9798

9899
git_info = commit_sha, response["sha"]
99-
current_list = json.loads(base64.b64decode(response["content"]).decode("utf-8"))
100+
101+
if response["content"] != "":
102+
# if the file is there
103+
current_list = json.loads(base64.b64decode(response["content"]).decode("utf-8"))
104+
else:
105+
# if too big, the file is not included
106+
download_url = response["download_url"]
107+
response = requests.get(download_url)
108+
if not response.ok:
109+
print(response.text)
110+
raise RuntimeError("cannot get previous files.json")
111+
current_list = response.json()
112+
100113
current_info = {}
101114
for info in current_list:
102115
current_info[info["id"]] = info

0 commit comments

Comments
 (0)
0