Skip to content

Commit

Permalink
Change data driven "str" type to represent a quoted string literal (q…
Browse files Browse the repository at this point in the history
…mk#16516)

* Change data driven "str" type to represent a quoted string literal

* Update docs
  • Loading branch information
fauxpark authored and lucas-atom committed Jun 24, 2022
1 parent 1ee030a commit 9b8dcca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/python/qmk/cli/generate/config_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 9b8dcca

Please sign in to comment.