Skip to content

Commit

Permalink
Add getProcessConfig
Browse files Browse the repository at this point in the history
This enables third-parties to construct their own `ExitCodeException`s
from `Process` values.
  • Loading branch information
9999years committed Aug 15, 2024
1 parent b58f1cb commit 2fc9f75
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/System/Process/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,18 @@ getStdout = pStdout
getStderr :: Process stdin stdout stderr -> stderr
getStderr = pStderr

-- | Get a process's configuration.
--
-- This is useful for constructing 'ExitCodeException's.
--
-- Note that the stdin, stdout, and stderr streams are stored in the 'Process',
-- not the 'ProcessConfig', so the returned 'ProcessConfig' will always have
-- empty stdin, stdout, and stderr values.
--
-- @since 0.2.12.0
getProcessConfig :: Process stdin stdout stderr -> ProcessConfig () () ()
getProcessConfig = pConfig

-- | Take 'System.Process.ProcessHandle' out of the 'Process'.
-- This method is needed in cases one need to use low level functions
-- from the @process@ package. Use cases for this method are:
Expand Down

0 comments on commit 2fc9f75

Please sign in to comment.