summaryrefslogtreecommitdiff
path: root/Build/EvilSplicer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-12-24 14:46:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-12-24 14:46:31 -0400
commit3b9d9a267b7c9247d36d9b622e1b836724ca5fb0 (patch)
tree7c57f49555835e462e0f69ba133bbfdaaf215368 /Build/EvilSplicer.hs
parent2aba1975e8192e7c60ef85118b40654b60cad027 (diff)
Always use filesystem encoding for all file and handle reads and writes.
This is a big scary change. I have convinced myself it should be safe. I hope!
Diffstat (limited to 'Build/EvilSplicer.hs')
-rw-r--r--Build/EvilSplicer.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs
index ca690c250..32d9a1c9f 100644
--- a/Build/EvilSplicer.hs
+++ b/Build/EvilSplicer.hs
@@ -210,7 +210,6 @@ applySplices destdir imports splices@(first:_) = do
when (oldcontent /= Just newcontent) $ do
putStrLn $ "splicing " ++ f
withFile dest WriteMode $ \h -> do
- fileEncoding h
hPutStr h newcontent
hClose h
where
@@ -721,7 +720,9 @@ parsecAndReplace p s = case parse find "" s of
find = many $ try (Right <$> p) <|> (Left <$> anyChar)
main :: IO ()
-main = go =<< getArgs
+main = do
+ useFileSystemEncoding
+ go =<< getArgs
where
go (destdir:log:header:[]) = run destdir log (Just header)
go (destdir:log:[]) = run destdir log Nothing