aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Data.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-01-13 01:09:56 +0100
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commitdbc6285489cb5171c611ebfd214e5c72d61a9dc8 (patch)
tree529b7ac7ff847f09855b32e9bc3b64f0c9f01e88 /src/CabalHelper/Compiletime/Data.hs
parent79988a8a5c2e3c1f29ca1e20c2d4a258863cd106 (diff)
Fix and refactor CH.C.Compile
..compilation outputs were landing in CWD
Diffstat (limited to 'src/CabalHelper/Compiletime/Data.hs')
-rw-r--r--src/CabalHelper/Compiletime/Data.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/CabalHelper/Compiletime/Data.hs b/src/CabalHelper/Compiletime/Data.hs
index ca291e9..4e512db 100644
--- a/src/CabalHelper/Compiletime/Data.hs
+++ b/src/CabalHelper/Compiletime/Data.hs
@@ -49,8 +49,8 @@ withSystemTempDirectoryEnv tpl f = do
tmpdir <- getCanonicalTemporaryDirectory
f =<< createTempDirectory tmpdir tpl
-withHelperSources :: Maybe FilePath -> (FilePath -> IO a) -> IO a
-withHelperSources mdir action = withDir mdir $ \dir -> do
+createHelperSources :: FilePath -> IO ()
+createHelperSources dir = do
let chdir = dir </> "CabalHelper"
liftIO $ do
createDirectoryIfMissing True $ chdir </> "Runtime"
@@ -70,11 +70,6 @@ withHelperSources mdir action = withDir mdir $ \dir -> do
BS.writeFile path $ UTF8.fromString src
setFileTimes path modtime modtime
- action dir
- where
- withDir (Just dir) = \f -> f dir
- withDir Nothing = withSystemTempDirectoryEnv "cabal-helper-source"
-
sourceFiles :: [(FilePath, String)]
sourceFiles =