diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index 893892c47949..c545dc936225 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -202,4 +202,20 @@ def generate_config_h(cli): generate_split_config(kb_info_json, config_h_lines) # Show the results +<<<<<<< HEAD dump_lines(cli.args.output, config_h_lines, cli.args.quiet) +======= + config_h = '\n'.join(config_h_lines) + + 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.parent / (cli.args.output.name + '.bak')) + cli.args.output.write_text(config_h, encoding='utf-8') + + if not cli.args.quiet: + cli.log.info('Wrote info_config.h to %s.', cli.args.output) + + else: + print(config_h) +>>>>>>> ace0603f4f (Change data driven "str" type to represent a quoted string literal (#16516))