Skip to content

Commit

Permalink
only write if file changed (#4822)
Browse files Browse the repository at this point in the history
* only write if file changed

* preface it on it existing
  • Loading branch information
adhami3310 authored Feb 14, 2025
1 parent 7c4257a commit 10bae95
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reflex/compiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ def write_page(path: str | Path, code: str):
"""
path = Path(path)
path_ops.mkdir(path.parent)
if path.exists() and path.read_text(encoding="utf-8") == code:
return
path.write_text(code, encoding="utf-8")


Expand Down

0 comments on commit 10bae95

Please sign in to comment.