diff options
Diffstat (limited to 'lib/python/qmk/cli/c2json.py')
-rw-r--r-- | lib/python/qmk/cli/c2json.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/c2json.py b/lib/python/qmk/cli/c2json.py index 2b3bb774f..8f9d8dc38 100644 --- a/lib/python/qmk/cli/c2json.py +++ b/lib/python/qmk/cli/c2json.py | |||
@@ -6,6 +6,7 @@ from milc import cli | |||
6 | 6 | ||
7 | import qmk.keymap | 7 | import qmk.keymap |
8 | import qmk.path | 8 | import qmk.path |
9 | from qmk.info_json_encoder import InfoJSONEncoder | ||
9 | 10 | ||
10 | 11 | ||
11 | @cli.argument('--no-cpp', arg_only=True, action='store_false', help='Do not use \'cpp\' on keymap.c') | 12 | @cli.argument('--no-cpp', arg_only=True, action='store_false', help='Do not use \'cpp\' on keymap.c') |
@@ -47,7 +48,7 @@ def c2json(cli): | |||
47 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) | 48 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) |
48 | if cli.args.output.exists(): | 49 | if cli.args.output.exists(): |
49 | cli.args.output.replace(cli.args.output.name + '.bak') | 50 | cli.args.output.replace(cli.args.output.name + '.bak') |
50 | cli.args.output.write_text(json.dumps(keymap_json)) | 51 | cli.args.output.write_text(json.dumps(keymap_json, cls=InfoJSONEncoder)) |
51 | 52 | ||
52 | if not cli.args.quiet: | 53 | if not cli.args.quiet: |
53 | cli.log.info('Wrote keymap to %s.', cli.args.output) | 54 | cli.log.info('Wrote keymap to %s.', cli.args.output) |