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/generate/config_h.py | |
parent | 1a7f2c8f453d4da6ed8622e52d5b788bc6dad480 (diff) | |
download | qmk_firmware-59c7deab0931207016315636ae1ef74c2c54dd18.tar.gz qmk_firmware-59c7deab0931207016315636ae1ef74c2c54dd18.zip |
Fix generated file output while target exists (#12062)
Diffstat (limited to 'lib/python/qmk/cli/generate/config_h.py')
-rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index 7ddad745d..e6d49ea4d 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py | |||
@@ -82,7 +82,7 @@ def generate_config_h(cli): | |||
82 | """ | 82 | """ |
83 | # Determine our keyboard(s) | 83 | # Determine our keyboard(s) |
84 | if not cli.config.generate_config_h.keyboard: | 84 | if not cli.config.generate_config_h.keyboard: |
85 | cli.log.error('Missing paramater: --keyboard') | 85 | cli.log.error('Missing parameter: --keyboard') |
86 | cli.subcommands['info'].print_help() | 86 | cli.subcommands['info'].print_help() |
87 | return False | 87 | return False |
88 | 88 | ||
@@ -142,7 +142,7 @@ def generate_config_h(cli): | |||
142 | if cli.args.output: | 142 | if cli.args.output: |
143 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) | 143 | cli.args.output.parent.mkdir(parents=True, exist_ok=True) |
144 | if cli.args.output.exists(): | 144 | if cli.args.output.exists(): |
145 | cli.args.output.replace(cli.args.output.name + '.bak') | 145 | cli.args.output.replace(cli.args.output.parent / (cli.args.output.name + '.bak')) |
146 | cli.args.output.write_text(config_h) | 146 | cli.args.output.write_text(config_h) |
147 | 147 | ||
148 | if not cli.args.quiet: | 148 | if not cli.args.quiet: |