simpler more generic processTranscript'

This allows using functions that generate CreateProcess and passing the
result to processTranscript', which is more flexible, and also simpler
than the old interface.

This commit was sponsored by Riku Voipio.
This commit is contained in:
Joey Hess 2017-02-15 16:00:59 -04:00
parent f07af03018
commit 113b10cdc9
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
3 changed files with 15 additions and 17 deletions

View file

@ -127,7 +127,7 @@ getOutput c ps environ = do
putStrLn $ unwords [c, show ps]
systemenviron <- getEnvironment
let environ' = fromMaybe [] environ ++ systemenviron
out@(_, ok) <- processTranscript' (\p -> p { Utility.Process.env = Just environ' }) c ps Nothing
out@(_, ok) <- processTranscript' ((proc c ps) { Utility.Process.env = Just environ' }) Nothing
putStrLn $ unwords [c, "finished", show ok]
return out