Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.Process.Run
Description
Run sub-processes.
- runCmd :: forall m. (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Cmd -> Maybe Text -> m ()
- runCmd' :: forall m. (MonadLogger m, MonadIO m, MonadBaseControl IO m) => (CreateProcess -> CreateProcess) -> Cmd -> Maybe Text -> m ()
- callProcess :: (MonadIO m, MonadLogger m) => Cmd -> m ()
- callProcess' :: (MonadIO m, MonadLogger m) => (CreateProcess -> CreateProcess) -> Cmd -> m ()
- callProcessInheritStderrStdout :: (MonadIO m, MonadLogger m) => Cmd -> m ()
- callProcessObserveStdout :: (MonadIO m, MonadLogger m) => Cmd -> m String
- createProcess' :: (MonadIO m, MonadLogger m) => String -> (CreateProcess -> CreateProcess) -> Cmd -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- data ProcessExitedUnsuccessfully :: *
- data Cmd = Cmd {}
Documentation
Arguments
:: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadBaseControl IO m) | |
=> Cmd | |
-> Maybe Text | optional additional error message |
-> m () |
Run the given command in the given directory, inheriting stdout and stderr.
If it exits with anything but success, prints an error
and then calls exitWith
to exit the program.
Arguments
:: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadBaseControl IO m) | |
=> (CreateProcess -> CreateProcess) | |
-> Cmd | |
-> Maybe Text | optional additional error message |
-> m () |
callProcess :: (MonadIO m, MonadLogger m) => Cmd -> m () Source #
Like callProcess
, but takes an optional working directory and
environment override, and throws ProcessExitedUnsuccessfully
if the
process exits unsuccessfully and a ReadProcessException
if the executable is not found.
Inherits stdout and stderr.
callProcess' :: (MonadIO m, MonadLogger m) => (CreateProcess -> CreateProcess) -> Cmd -> m () Source #
Like callProcess
, but takes an optional working directory and
environment override, and throws ProcessExitedUnsuccessfully
if the
process exits unsuccessfully and a ReadProcessException
if the executable is not found.
Inherits stdout and stderr.
callProcessInheritStderrStdout :: (MonadIO m, MonadLogger m) => Cmd -> m () Source #
callProcessObserveStdout :: (MonadIO m, MonadLogger m) => Cmd -> m String Source #
createProcess' :: (MonadIO m, MonadLogger m) => String -> (CreateProcess -> CreateProcess) -> Cmd -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) Source #
Like createProcess_
, but taking a Cmd
.
Note that the Handle
s provided by UseHandle
are not closed
automatically.
data ProcessExitedUnsuccessfully :: * #
Indicates that a process exited with an non-success exit code.
Since 0.1.7
Cmd holds common infos needed to running a process in most cases
Constructors
Cmd | |
Fields
|