-- | Try to produce strict 'S.ByteString's from the stderr and stdout of a
-- process.
tryProcessStderrStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m)
                       => Maybe (Path Abs Dir) -- ^ Optional directory to run in
                       -> EnvOverride
                       -> String -- ^ Command
                       -> [String] -- ^ Command line arguments
                       -> m (Either ReadProcessException (S.ByteString, S.ByteString))
tryProcessStderrStdout wd menv name args =
    try (readProcessStderrStdout wd menv name args)
tryProcessStderrStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m)
                       => Maybe (Path Abs Dir) -- ^ Optional directory to run in
                       -> EnvOverride
                       -> String -- ^ Command
                       -> [String] -- ^ Command line arguments
                       -> m (Either ReadProcessException (S.ByteString, S.ByteString))
tryProcessStderrStdout wd menv name args =
    try (readProcessStderrStdout wd menv name args)
tryProcessStderrStdout wd menv name args =
    try (readProcessStderrStdout wd menv name args)