diff options
author | QMK Bot <[email protected]> | 2024-07-24 05:17:22 +0000 |
---|---|---|
committer | QMK Bot <[email protected]> | 2024-07-24 05:17:22 +0000 |
commit | c25b3bbe90881de411ab2e3ba2720b51d38060b0 (patch) | |
tree | 15f0e5faf714e21077b18db98a8d3941510c9def | |
parent | c45e75037bcb10691ee26ca41d7c2c119170c3bf (diff) | |
parent | 8c35011d0aa242e9f6271d3a66ae6924d52bbed6 (diff) | |
download | qmk_firmware-c25b3bbe90881de411ab2e3ba2720b51d38060b0.tar.gz qmk_firmware-c25b3bbe90881de411ab2e3ba2720b51d38060b0.zip |
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r-- | lib/python/qmk/commands.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 873380c28b..b0b8ccb244 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -101,6 +101,12 @@ def dump_lines(output_file, lines, quiet=True): if output_file and output_file.name != '-': output_file.parent.mkdir(parents=True, exist_ok=True) if output_file.exists(): + with open(output_file, 'r', encoding='utf-8', newline='\n') as f: + existing = f.read() + if existing == generated: + if not quiet: + cli.log.info(f'No changes to {output_file.name}.') + return output_file.replace(output_file.parent / (output_file.name + '.bak')) with open(output_file, 'w', encoding='utf-8', newline='\n') as f: f.write(generated) |