From ac67d1f057ce0aafcca3f72a965444d10010d5a3 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Wed, 19 Aug 2015 16:11:27 +0200 Subject: Make Hoogle backend create output directory if needed. --- haddock-api/src/Haddock/Backends/Hoogle.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'haddock-api/src/Haddock/Backends') diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index f6ad9808..945488d0 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -30,6 +30,8 @@ import Data.Char import Data.List import Data.Maybe import Data.Version + +import System.Directory import System.FilePath import System.IO @@ -48,6 +50,7 @@ ppHoogle dflags package version synopsis prologue ifaces odir = do ["@version " ++ showVersion version | not (null (versionBranch version)) ] ++ concat [ppModule dflags i | i <- ifaces, OptHide `notElem` ifaceOptions i] + createDirectoryIfMissing True odir h <- openFile (odir filename) WriteMode hSetEncoding h utf8 hPutStr h (unlines contents) -- cgit v1.2.3