Skip to content

Commit aff958f

Browse files
committed
Skip writes when unecessary to avoid live recompilation
1 parent 5a6b8c4 commit aff958f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extra/Lamdera/CLI/Live.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ serveExperimentalWrite root path = do
336336
fullpath = root </> (T.unpack path)
337337
debug $ "_x/write: " ++ show fullpath
338338

339-
liftIO $ writeUtf8 fullpath (TL.toStrict $ TL.decodeUtf8 rbody)
339+
liftIO $ writeIfDifferent fullpath (TL.toStrict $ TL.decodeUtf8 rbody)
340340
jsonResponse $ B.byteString $ "{ written: '" <> T.encodeUtf8 (T.pack fullpath) <> "'}"
341341

342342

0 commit comments

Comments
 (0)