implementing suppressStdout/err.

This commit is contained in:
Kazu Yamamoto
2014-04-18 15:41:32 +09:00
parent 5006d836e1
commit aecb9bc1e4
4 changed files with 46 additions and 18 deletions

View File

@@ -18,6 +18,7 @@ import Data.Char (isSpace,isAlphaNum)
import Data.List (isPrefixOf, intercalate)
import Data.Maybe (listToMaybe, maybeToList)
import Language.Haskell.GhcMod.Types
import Language.Haskell.GhcMod.Utils
import System.FilePath ((</>))
import System.Process (readProcess)
import Text.ParserCombinators.ReadP
@@ -65,8 +66,7 @@ ghcPkgList dbs = map fst3 <$> ghcPkgListEx dbs
ghcPkgListEx :: [GhcPkgDb] -> IO [Package]
ghcPkgListEx dbs = do
output <- readProcess "ghc-pkg" opts ""
-- hPutStrLn stderr output
output <- suppressStderr $ readProcess "ghc-pkg" opts ""
return $ parseGhcPkgOutput $ lines output
where
opts = ["list", "-v"] ++ ghcPkgDbStackOpts dbs