Use readProcess'
in PkgDoc.hs
This commit is contained in:
parent
274b5d8e1c
commit
83d780015c
@ -3,18 +3,19 @@ module Language.Haskell.GhcMod.PkgDoc (pkgDoc) where
|
|||||||
import Language.Haskell.GhcMod.Types
|
import Language.Haskell.GhcMod.Types
|
||||||
import Language.Haskell.GhcMod.GhcPkg
|
import Language.Haskell.GhcMod.GhcPkg
|
||||||
import Language.Haskell.GhcMod.Monad
|
import Language.Haskell.GhcMod.Monad
|
||||||
|
import Language.Haskell.GhcMod.Utils
|
||||||
|
|
||||||
import Control.Applicative ((<$>))
|
import Control.Applicative ((<$>))
|
||||||
import System.Process (readProcess)
|
|
||||||
|
|
||||||
-- | Obtaining the package name and the doc path of a module.
|
-- | Obtaining the package name and the doc path of a module.
|
||||||
pkgDoc :: IOish m => String -> GhcModT m String
|
pkgDoc :: IOish m => String -> GhcModT m String
|
||||||
pkgDoc mdl = cradle >>= \c -> liftIO $ do
|
pkgDoc mdl = do
|
||||||
pkg <- trim <$> readProcess "ghc-pkg" (toModuleOpts c) []
|
c <- cradle
|
||||||
|
pkg <- trim <$> readProcess' "ghc-pkg" (toModuleOpts c)
|
||||||
if pkg == "" then
|
if pkg == "" then
|
||||||
return "\n"
|
return "\n"
|
||||||
else do
|
else do
|
||||||
htmlpath <- readProcess "ghc-pkg" (toDocDirOpts pkg c) []
|
htmlpath <- readProcess' "ghc-pkg" (toDocDirOpts pkg c)
|
||||||
let ret = pkg ++ " " ++ drop 14 htmlpath
|
let ret = pkg ++ " " ++ drop 14 htmlpath
|
||||||
return ret
|
return ret
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user