From 136c48c5fe074ac8a2755c4705d555de24e22a3a Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Mon, 24 Aug 2015 23:09:20 +0200 Subject: Fix bug with accepting to non-existing directory. --- haddock-test/src/Test/Haddock/Utils.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'haddock-test/src/Test/Haddock/Utils.hs') diff --git a/haddock-test/src/Test/Haddock/Utils.hs b/haddock-test/src/Test/Haddock/Utils.hs index 4f97fa72..a947fea1 100644 --- a/haddock-test/src/Test/Haddock/Utils.hs +++ b/haddock-test/src/Test/Haddock/Utils.hs @@ -41,3 +41,10 @@ createEmptyDirectory :: FilePath -> IO () createEmptyDirectory path = do whenM (doesDirectoryExist path) $ removeDirectoryRecursive path createDirectory path + + +-- | Just like 'copyFile' but output directory path is not required to exist. +copyFile' :: FilePath -> FilePath -> IO () +copyFile' old new = do + createDirectoryIfMissing True $ takeDirectory new + copyFile old new -- cgit v1.2.3