preface it on it existing

This commit is contained in:
Khaleel Al-Adhami 2025-02-13 17:39:11 -08:00
parent 51604fcfdb
commit 225e290206

View File

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