Fix more `qmk generate-api` fallout from userspace support (#22619)

master
Sergey Vlasov 2023-12-06 09:59:42 +03:00 committed by GitHub
parent f1043e3a92
commit 958215e9d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -128,12 +128,15 @@ def generate_api(cli):
# Populate the list of JSON keymaps # Populate the list of JSON keymaps
for keymap in list_keymaps(keyboard_name, c=False, fullpath=True): for keymap in list_keymaps(keyboard_name, c=False, fullpath=True):
keymap_rel = qmk.path.under_qmk_firmware(keymap) keymap_rel = qmk.path.under_qmk_firmware(keymap)
if keymap_rel is None:
cli.log.debug('Skipping keymap %s (not in qmk_firmware)', keymap)
continue
kb_json['keymaps'][keymap.name] = { kb_json['keymaps'][keymap.name] = {
# TODO: deprecate 'url' as consumer needs to know its potentially hjson # TODO: deprecate 'url' as consumer needs to know its potentially hjson
'url': f'https://raw.githubusercontent.com/qmk/qmk_firmware/master/{keymap_rel}/keymap.json', 'url': f'https://raw.githubusercontent.com/qmk/qmk_firmware/master/{keymap_rel}/keymap.json',
# Instead consumer should grab from API and not repo directly # Instead consumer should grab from API and not repo directly
'path': (keymap / 'keymap.json').as_posix(), 'path': (keymap_rel / 'keymap.json').as_posix(),
} }
keyboard_dir.mkdir(parents=True, exist_ok=True) keyboard_dir.mkdir(parents=True, exist_ok=True)