only write if file changed

This commit is contained in:
Khaleel Al-Adhami 2025-02-13 17:37:10 -08:00
parent 8e579efe47
commit 51604fcfdb

View File

@ -523,6 +523,8 @@ def write_page(path: str | Path, code: str):
"""
path = Path(path)
path_ops.mkdir(path.parent)
if path.read_text(encoding="utf-8") == code:
return
path.write_text(code, encoding="utf-8")