diff options
author | skullY <skullydazed@gmail.com> | 2019-11-12 17:08:55 -0800 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-11-12 20:37:28 -0800 |
commit | 00fb1bd1f0550645997b61870d7d092494265a60 (patch) | |
tree | bcedba92b50be959cb67c035e4280348ab6eb5ae | |
parent | 79edb7c5942108774e667c172550a1519c5543ac (diff) | |
download | qmk_firmware-00fb1bd1f0550645997b61870d7d092494265a60.tar.gz qmk_firmware-00fb1bd1f0550645997b61870d7d092494265a60.zip |
Make generating keymap.c from JSON more reliable
-rw-r--r-- | build_json.mk | 5 | ||||
-rwxr-xr-x | lib/python/qmk/cli/json/keymap.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/build_json.mk b/build_json.mk index e2a33e3b6..3e7dc95c0 100644 --- a/build_json.mk +++ b/build_json.mk | |||
@@ -22,6 +22,5 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","") | |||
22 | endif | 22 | endif |
23 | 23 | ||
24 | # Generate the keymap.c | 24 | # Generate the keymap.c |
25 | ifneq ("$(KEYMAP_JSON)","") | 25 | $(KEYBOARD_OUTPUT)/src/keymap.c: |
26 | _ = $(shell test -e $(KEYMAP_C) || bin/qmk json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C)) | 26 | bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON) |
27 | endif | ||
diff --git a/lib/python/qmk/cli/json/keymap.py b/lib/python/qmk/cli/json/keymap.py index 207ac278c..7b7553104 100755 --- a/lib/python/qmk/cli/json/keymap.py +++ b/lib/python/qmk/cli/json/keymap.py | |||
@@ -10,6 +10,7 @@ import qmk.keymap | |||
10 | 10 | ||
11 | 11 | ||
12 | @cli.argument('-o', '--output', arg_only=True, help='File to write to') | 12 | @cli.argument('-o', '--output', arg_only=True, help='File to write to') |
13 | @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") | ||
13 | @cli.argument('filename', arg_only=True, help='Configurator JSON file') | 14 | @cli.argument('filename', arg_only=True, help='Configurator JSON file') |
14 | @cli.subcommand('Creates a keymap.c from a QMK Configurator export.') | 15 | @cli.subcommand('Creates a keymap.c from a QMK Configurator export.') |
15 | def json_keymap(cli): | 16 | def json_keymap(cli): |
@@ -48,7 +49,8 @@ def json_keymap(cli): | |||
48 | with open(output_file, 'w') as keymap_fd: | 49 | with open(output_file, 'w') as keymap_fd: |
49 | keymap_fd.write(keymap_c) | 50 | keymap_fd.write(keymap_c) |
50 | 51 | ||
51 | cli.log.info('Wrote keymap to %s.', cli.args.output) | 52 | if not cli.args.quiet: |
53 | cli.log.info('Wrote keymap to %s.', cli.args.output) | ||
52 | 54 | ||
53 | else: | 55 | else: |
54 | print(keymap_c) | 56 | print(keymap_c) |