aedi: `BuildTarget.update_text_file()` writes to disk only when content is changed

This commit is contained in:
alexey.lysiuk 2023-03-22 11:50:17 +02:00
parent 302d046ff6
commit 06c741fbc1
1 changed files with 3 additions and 0 deletions

View File

@ -128,6 +128,9 @@ class BuildTarget(Target):
if patched_line:
patched_content.append(patched_line)
if content == patched_content:
return
with open(path, 'w') as f:
f.writelines(patched_content)