packages feed

process-conduit 0.0.2 → 0.0.3

raw patch · 2 files changed

+15/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Data/Conduit/Process.hs view
@@ -16,6 +16,7 @@   ProcessHandle,   ) where +import Control.Applicative import Control.Exception import Control.Monad import Control.Monad.Trans@@ -57,11 +58,20 @@      close (Just cin, Just cout, _, ph) = liftIO $ do       hClose cin-      ec <- waitForProcess ph-      when (ec /= ExitSuccess) $ throwIO ec-      str <- B.hGetContents cout+      ret <- getRest       hClose cout-      return [str]+      return ret+      where+        getRest = do+          mbec <- getProcessExitCode ph+          case mbec of+            Nothing -> do+              str <- B.hGetNonBlocking cout bufSize+              (str:) <$> getRest+            Just ec -> do+              when (ec /= ExitSuccess) $ throwIO ec+              str <- B.hGetContents cout+              return [str]  sourceCmd :: C.ResourceIO m => String -> C.Source m B.ByteString sourceCmd cmd = CL.sourceNull C.$= conduitCmd cmd
process-conduit.cabal view
@@ -1,5 +1,5 @@ Name:                process-conduit-Version:             0.0.2+Version:             0.0.3 Synopsis:            Conduit for process Description:         Conduit for process Homepage:            http://github.com/tanakh/process-conduit