Skip to content

Commit 10bae95

Browse files
authored
only write if file changed (#4822)
* only write if file changed * preface it on it existing
1 parent 7c4257a commit 10bae95

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

reflex/compiler/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,8 @@ def write_page(path: str | Path, code: str):
523523
"""
524524
path = Path(path)
525525
path_ops.mkdir(path.parent)
526+
if path.exists() and path.read_text(encoding="utf-8") == code:
527+
return
526528
path.write_text(code, encoding="utf-8")
527529

528530

0 commit comments

Comments
 (0)