@@ -13,6 +13,7 @@ module Obelisk.CliApp.Process
1313 , AsProcessFailure (..)
1414 , readProcessAndLogStderr
1515 , readProcessAndLogOutput
16+ , readCreateProcessWithExitCode
1617 , callProcessAndLogOutput
1718 , createProcess
1819 , createProcess_
@@ -65,6 +66,13 @@ readProcessAndLogStderr sev process = do
6566 streamToLog =<< liftIO (streamHandle sev err)
6667 liftIO $ T.decodeUtf8 <$> BS.hGetContents out
6768
69+readCreateProcessWithExitCode
70+ :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e)
71+ => CreateProcess -> m (ExitCode, String, String)
72+readCreateProcessWithExitCode process = do
73+ putLog Debug $ "Creating process: " <> reconstructCommand (cmdspec process)
74+ liftIO $ Process.readCreateProcessWithExitCode process ""
75+
6876-- | Like `System.Process.readProcess` but logs the combined output (stdout and stderr)
6977-- with the corresponding severity.
7078--