REF clean up process functions
This commit is contained in:
parent
9086915e52
commit
b6f32a1b0f
|
@ -152,9 +152,7 @@ readCmdEither
|
|||
-> [T.Text]
|
||||
-> T.Text
|
||||
-> IO (Either (Int, T.Text, T.Text) T.Text)
|
||||
readCmdEither cmd args input =
|
||||
resultToEither
|
||||
<$> readProcessWithExitCode (T.unpack cmd) (fmap T.unpack args) (T.unpack input)
|
||||
readCmdEither cmd args input = readCmdEither' cmd args input []
|
||||
|
||||
readCmdEither'
|
||||
:: T.Text
|
||||
|
@ -166,10 +164,10 @@ readCmdEither' cmd args input environ =
|
|||
resultToEither
|
||||
<$> readCreateProcessWithExitCode p (T.unpack input)
|
||||
where
|
||||
p =
|
||||
(proc (T.unpack cmd) (fmap T.unpack args))
|
||||
{ env = Just $ fmap (bimap T.unpack T.unpack) environ
|
||||
}
|
||||
e = case environ of
|
||||
[] -> Nothing
|
||||
es -> Just $ fmap (bimap T.unpack T.unpack) es
|
||||
p = (proc (T.unpack cmd) (fmap T.unpack args)) {env = e}
|
||||
|
||||
resultToEither
|
||||
:: (ExitCode, String, String)
|
||||
|
|
Loading…
Reference in New Issue