1
0
Fork 0

Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
QMK Bot 2020-12-19 18:47:05 +00:00
commit 32f53c0671
2 changed files with 8 additions and 4 deletions

View file

@ -36,7 +36,7 @@ def generate_api(cli):
keyboard_readme_src = Path('keyboards') / keyboard_name / 'readme.md'
keyboard_dir.mkdir(parents=True, exist_ok=True)
keyboard_info.write_text(json.dumps(kb_all['keyboards'][keyboard_name]))
keyboard_info.write_text(json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_all['keyboards'][keyboard_name]}}))
if keyboard_readme_src.exists():
copyfile(keyboard_readme_src, keyboard_readme)

View file

@ -230,11 +230,15 @@ def merge_info_jsons(keyboard, info_data):
"""
for info_file in find_info_json(keyboard):
# Load and validate the JSON data
with info_file.open('r') as info_fd:
new_info_data = json.load(info_fd)
try:
with info_file.open('r') as info_fd:
new_info_data = json.load(info_fd)
except Exception as e:
_log_error(info_data, "Invalid JSON in file %s: %s: %s" % (str(info_file), e.__class__.__name__, e))
continue
if not isinstance(new_info_data, dict):
_log_error(info_data, "Invalid file %s, root object should be a dictionary.", str(info_file))
_log_error(info_data, "Invalid file %s, root object should be a dictionary." % (str(info_file),))
continue
# Copy whitelisted keys into `info_data`