summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/generate/api.py
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-05-25 02:39:02 +0000
committerQMK Bot <hello@qmk.fm>2021-05-25 02:39:02 +0000
commit8e22da67c1ddafa45b2e4d0ec4449dc79b509b89 (patch)
tree95892911e375ff6ce01ec39bc3a3b419987af826 /lib/python/qmk/cli/generate/api.py
parent330fe1d1cc873ee24e7df49041cfa292a7662cb1 (diff)
parentbc67ca6a59ffa3d6e147b276c0544791e5f91d02 (diff)
downloadqmk_firmware-8e22da67c1ddafa45b2e4d0ec4449dc79b509b89.tar.gz
qmk_firmware-8e22da67c1ddafa45b2e4d0ec4449dc79b509b89.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/cli/generate/api.py')
-rwxr-xr-xlib/python/qmk/cli/generate/api.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/qmk/cli/generate/api.py b/lib/python/qmk/cli/generate/api.py
index 8ab7522a76..285bd90eb5 100755
--- a/lib/python/qmk/cli/generate/api.py
+++ b/lib/python/qmk/cli/generate/api.py
@@ -10,7 +10,7 @@ from qmk.datetime import current_datetime
from qmk.info import info_json
from qmk.json_encoders import InfoJSONEncoder
from qmk.json_schema import json_load
-from qmk.keyboard import list_keyboards
+from qmk.keyboard import find_readme, list_keyboards
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't write the data to disk.")
@@ -38,7 +38,7 @@ def generate_api(cli):
keyboard_dir = v1_dir / 'keyboards' / keyboard_name
keyboard_info = keyboard_dir / 'info.json'
keyboard_readme = keyboard_dir / 'readme.md'
- keyboard_readme_src = Path('keyboards') / keyboard_name / 'readme.md'
+ keyboard_readme_src = find_readme(keyboard_name)
keyboard_dir.mkdir(parents=True, exist_ok=True)
keyboard_json = json.dumps({'last_updated': current_datetime(), 'keyboards': {keyboard_name: kb_all[keyboard_name]}})
@@ -46,7 +46,7 @@ def generate_api(cli):
keyboard_info.write_text(keyboard_json)
cli.log.debug('Wrote file %s', keyboard_info)
- if keyboard_readme_src.exists():
+ if keyboard_readme_src:
copyfile(keyboard_readme_src, keyboard_readme)
cli.log.debug('Copied %s -> %s', keyboard_readme_src, keyboard_readme)