summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-11-12 13:48:34 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-11-12 13:48:34 +0100
commit4425e2e44020239bbe227c0b499fdb2d902461bc (patch)
treee161c3e2aeb1146acf666cf2e07891fe575ba18f
parent6a979442098cdd17a6da4d7871b3b4412aec1c21 (diff)
delete file before overwrite it
-rw-r--r--ddl/Generate.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ddl/Generate.hs b/ddl/Generate.hs
index bf0d016..261c2e5 100644
--- a/ddl/Generate.hs
+++ b/ddl/Generate.hs
@@ -67,7 +67,7 @@ main = do
67 oldTxt <- readFile fname 67 oldTxt <- readFile fname
68 case (lines oldTxt, lines txt) of 68 case (lines oldTxt, lines txt) of
69 (_ : oldTime : old, _ : newTime : new) | old == new -> return () -- NOTE: timestamp is always in the second line 69 (_ : oldTime : old, _ : newTime : new) | old == new -> return () -- NOTE: timestamp is always in the second line
70 _ -> writeFile fname txt 70 _ -> removeFile fname >> writeFile fname txt
71 71
72 -- Haskell 72 -- Haskell
73 either error (\x -> writeFileIfDiffer ("out/" ++ name ++ ".hs") $ LText.unpack x) $ dataHs >>= (\t -> eitherRenderWith mylib t env) 73 either error (\x -> writeFileIfDiffer ("out/" ++ name ++ ".hs") $ LText.unpack x) $ dataHs >>= (\t -> eitherRenderWith mylib t env)