From 59c7deab0931207016315636ae1ef74c2c54dd18 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 28 Feb 2021 20:19:07 +0000 Subject: Fix generated file output while target exists (#12062) --- lib/python/qmk/cli/c2json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/qmk/cli/c2json.py') 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): if cli.args.output: cli.args.output.parent.mkdir(parents=True, exist_ok=True) if cli.args.output.exists(): - cli.args.output.replace(cli.args.output.name + '.bak') + cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) cli.args.output.write_text(json.dumps(keymap_json, cls=InfoJSONEncoder)) if not cli.args.quiet: -- cgit v1.2.1