diff options
| author | Joel Challis <git@zvecr.com> | 2021-02-28 20:19:07 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-28 20:19:07 +0000 |
| commit | 59c7deab0931207016315636ae1ef74c2c54dd18 (patch) | |
| tree | 4ebcb8c97c2bee8c3ea6ee3496851184f821729f /lib/python/qmk/cli/c2json.py | |
| parent | 1a7f2c8f453d4da6ed8622e52d5b788bc6dad480 (diff) | |
Fix generated file output while target exists (#12062)
Diffstat (limited to 'lib/python/qmk/cli/c2json.py')
| -rw-r--r-- | lib/python/qmk/cli/c2json.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/c2json.py b/lib/python/qmk/cli/c2json.py index 8f9d8dc383..b9d55ebdbc 100644 --- a/lib/python/qmk/cli/c2json.py +++ b/lib/python/qmk/cli/c2json.py | |||
| @@ -47,7 +47,7 @@ def c2json(cli): | |||
| 47 | if cli.args.output: | 47 | if cli.args.output: |
| 48 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) | 48 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) |
| 49 | if cli.args.output.exists(): | 49 | if cli.args.output.exists(): |
| 50 | cli.args.output.replace(cli.args.output.name + '.bak') | 50 | cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) |
| 51 | cli.args.output.write_text(json.dumps(keymap_json, cls=InfoJSONEncoder)) | 51 | cli.args.output.write_text(json.dumps(keymap_json, cls=InfoJSONEncoder)) |
| 52 | 52 | ||
| 53 | if not cli.args.quiet: | 53 | if not cli.args.quiet: |
