diff options
author | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-19 16:11:27 +0200 |
---|---|---|
committer | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-08-22 23:40:28 +0200 |
commit | ac67d1f057ce0aafcca3f72a965444d10010d5a3 (patch) | |
tree | ad1860e794bb27a898b7980cd3c0da5d6659ff55 | |
parent | acf526f68d0ecb3ddf4ddd6efcee7774cd8ffa54 (diff) |
Make Hoogle backend create output directory if needed.
-rw-r--r-- | haddock-api/src/Haddock/Backends/Hoogle.hs | 3 |
1 files changed, 3 insertions, 0 deletions
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) |