]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Make generating keymap.c from JSON more reliable
authorskullY <skullydazed@gmail.com>
Wed, 13 Nov 2019 01:08:55 +0000 (17:08 -0800)
committerskullydazed <skullydazed@users.noreply.github.com>
Wed, 13 Nov 2019 04:37:28 +0000 (20:37 -0800)
build_json.mk
lib/python/qmk/cli/json/keymap.py

index e2a33e3b6a5ca2efb3e9fe035484fcc1962aaa1c..3e7dc95c0c1688cd0de7df8c5ad8afd3a170eeba 100644 (file)
@@ -22,6 +22,5 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
 endif
 
 # Generate the keymap.c
-ifneq ("$(KEYMAP_JSON)","")
-    _ = $(shell test -e $(KEYMAP_C) || bin/qmk json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C))
-endif
+$(KEYBOARD_OUTPUT)/src/keymap.c:
+       bin/qmk json-keymap --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
index 207ac278cafe1099c7952dc4043c813a2e5e1014..7b7553104f02b3d1b00382ea7c1afb488d3c7cce 100755 (executable)
@@ -10,6 +10,7 @@ import qmk.keymap
 
 
 @cli.argument('-o', '--output', arg_only=True, help='File to write to')
+@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
 @cli.argument('filename', arg_only=True, help='Configurator JSON file')
 @cli.subcommand('Creates a keymap.c from a QMK Configurator export.')
 def json_keymap(cli):
@@ -48,7 +49,8 @@ def json_keymap(cli):
         with open(output_file, 'w') as keymap_fd:
             keymap_fd.write(keymap_c)
 
-        cli.log.info('Wrote keymap to %s.', cli.args.output)
+        if not cli.args.quiet:
+            cli.log.info('Wrote keymap to %s.', cli.args.output)
 
     else:
         print(keymap_c)