error handling for doc.
This commit is contained in:
parent
187f718de0
commit
5dbea7b909
@ -14,6 +14,9 @@ packageDoc _ cradle mdl = pkgDoc cradle mdl
|
|||||||
pkgDoc :: Cradle -> String -> IO String
|
pkgDoc :: Cradle -> String -> IO String
|
||||||
pkgDoc cradle mdl = do
|
pkgDoc cradle mdl = do
|
||||||
pkg <- trim <$> readProcess "ghc-pkg" toModuleOpts []
|
pkg <- trim <$> readProcess "ghc-pkg" toModuleOpts []
|
||||||
|
if pkg == "" then
|
||||||
|
return "\n"
|
||||||
|
else do
|
||||||
htmlpath <- readProcess "ghc-pkg" ["field", pkg, "haddock-html"] []
|
htmlpath <- readProcess "ghc-pkg" ["field", pkg, "haddock-html"] []
|
||||||
let ret = pkg ++ " " ++ drop 14 htmlpath
|
let ret = pkg ++ " " ++ drop 14 htmlpath
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user