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