Skip to content

Commit 7d557a0

Browse files
authored
Fix compiling json files. (qmk#6340)
1 parent a25dd58 commit 7d557a0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

build_json.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ endif
2323

2424
# Generate the keymap.c
2525
ifneq ("$(KEYMAP_JSON)","")
26-
_ = $(shell bin/qmk-json-keymap -f $(KEYMAP_JSON) -o $(KEYMAP_C))
26+
_ = $(shell test -e $(KEYMAP_C) || bin/qmk-json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C))
2727
endif

lib/python/qmk/cli/json/keymap.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def main(cli):
2828
exit(1)
2929

3030
# Environment processing
31-
if cli.args.output == ('-'):
32-
cli.args.output = None
31+
if cli.config.general.output == ('-'):
32+
cli.config.general.output = None
3333

3434
# Parse the configurator json
3535
with open(qmk.path.normpath(cli.args.filename), 'r') as fd:
@@ -38,17 +38,17 @@ def main(cli):
3838
# Generate the keymap
3939
keymap_c = qmk.keymap.generate(user_keymap['keyboard'], user_keymap['layout'], user_keymap['layers'])
4040

41-
if cli.args.output:
42-
output_dir = os.path.dirname(cli.args.output)
41+
if cli.config.general.output:
42+
output_dir = os.path.dirname(cli.config.general.output)
4343

4444
if not os.path.exists(output_dir):
4545
os.makedirs(output_dir)
4646

47-
output_file = qmk.path.normpath(cli.args.output)
47+
output_file = qmk.path.normpath(cli.config.general.output)
4848
with open(output_file, 'w') as keymap_fd:
4949
keymap_fd.write(keymap_c)
5050

51-
cli.log.info('Wrote keymap to %s.', cli.args.output)
51+
cli.log.info('Wrote keymap to %s.', cli.config.general.output)
5252

5353
else:
5454
print(keymap_c)

lib/python/qmk/keymap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def generate(keyboard, layout, layers):
6363
layer_txt.append('\t[%s] = %s(%s)' % (layer_num, layout, layer_keys))
6464

6565
keymap = '\n'.join(layer_txt)
66-
keymap_c = template(keyboard, keymap)
66+
keymap_c = template(keyboard)
6767

6868
return keymap_c.replace('__KEYMAP_GOES_HERE__', keymap)
6969

0 commit comments

Comments
 (0)