소스 검색

only write if file changed (#4822)

* only write if file changed

* preface it on it existing
Khaleel Al-Adhami 3 달 전
부모
커밋
10bae9577c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      reflex/compiler/utils.py

+ 2 - 0
reflex/compiler/utils.py

@@ -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")