REF clean up process functions

This commit is contained in:
Nathan Dwarshuis 2023-02-15 22:43:46 -05:00
parent 9086915e52
commit b6f32a1b0f
1 changed files with 5 additions and 7 deletions

View File

@ -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)