From dbc6285489cb5171c611ebfd214e5c72d61a9dc8 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sat, 13 Jan 2018 01:09:56 +0100 Subject: Fix and refactor CH.C.Compile ..compilation outputs were landing in CWD --- src/CabalHelper/Compiletime/Data.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/CabalHelper/Compiletime/Data.hs') 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 = -- cgit v1.2.3