Safe Haskell | None |
---|---|
Language | Haskell2010 |
This modules contains support for external command execution.
Since: 0.5.65
Synopsis
- cmd :: (HasCallStack, Member ExcB9 e, CommandIO e) => String -> Eff e ()
- cmdStdout :: (HasCallStack, Member ExcB9 e, CommandIO e) => String -> Eff e ByteString
- cmdInteractive :: (HasCallStack, Member ExcB9 e, Member BuildInfoReader e, CommandIO e) => String -> Eff e ()
- hostCmdEither :: forall e. CommandIO e => HostCommandStdin -> String -> Maybe Timeout -> Eff e (Either Timeout ExitCode)
- hostCmdStdoutEither :: forall e a. CommandIO e => HostCommandStdin -> HostCommandStdout a -> String -> Maybe Timeout -> Eff e (Either Timeout a)
- hostCmd :: (CommandIO e, Member ExcB9 e) => String -> Maybe Timeout -> Eff e Bool
- hostCmdStdIn :: (CommandIO e, Member ExcB9 e) => HostCommandStdin -> String -> Maybe Timeout -> Eff e Bool
- newtype Timeout = TimeoutMicros Int
- ptyCmdInteractive :: (HasCallStack, Member ExcB9 e, Member BuildInfoReader e, CommandIO e) => Maybe Timeout -> String -> [String] -> Eff e ()
- data HostCommandStdin
- data HostCommandStdout a where
Documentation
cmdStdout :: (HasCallStack, Member ExcB9 e, CommandIO e) => String -> Eff e ByteString Source #
cmdInteractive :: (HasCallStack, Member ExcB9 e, Member BuildInfoReader e, CommandIO e) => String -> Eff e () Source #
Execute the given shell command.
If isInteractive
is true, the standard-in will be passed to the external command,
and all output of the program will be directed to standard-out.
The command and the output is either logged to the logfile with traceL
or errorL
or
written to stdout.
If the command exists with non-zero exit code, the current process exists with the same exit code.
Since: 2.0.0
:: forall e. CommandIO e | |
=> HostCommandStdin | A |
-> String | The shell command to execute. |
-> Maybe Timeout | An optional |
-> Eff e (Either Timeout ExitCode) |
Run a shell command defined by a string and optionally interrupt the command after a given time has elapsed. This is only useful for non-interactive commands.
Since: 1.0.0
:: forall e a. CommandIO e | |
=> HostCommandStdin | A |
-> HostCommandStdout a | A |
-> String | The shell command to execute. |
-> Maybe Timeout | An optional |
-> Eff e (Either Timeout a) |
Run a shell command defined by a string and optionally interrupt the command after a given time has elapsed. This is only useful for non-interactive commands.
Also provide the possibility to receive the stdout of the command. It of course be collected in ram, so be sure the command doesn't have to much output.
Since: 3.1.0
:: (CommandIO e, Member ExcB9 e) | |
=> String | The shell command to execute. |
-> Maybe Timeout | An optional |
-> Eff e Bool | An action that performs the shell command and returns |
Run a shell command defined by a string and optionally interrupt the command
after a given time has elapsed.
If the shell command did not exit with ExitSuccess
, or the timer elapsed,
a B9Error
is thrown.
This is only useful for non-interactive commands.
Since: 1.0.0
:: (CommandIO e, Member ExcB9 e) | |
=> HostCommandStdin | A |
-> String | The shell command to execute. |
-> Maybe Timeout | An optional |
-> Eff e Bool | An action that performs the shell command and returns |
Like hostCmd
but with std-input attached.
Since: 1.0.0
A way to specify a time intervall for example for the timeouts of system commands.
Since: 1.1.0
ptyCmdInteractive :: (HasCallStack, Member ExcB9 e, Member BuildInfoReader e, CommandIO e) => Maybe Timeout -> String -> [String] -> Eff e () Source #
Execute the given shell command in a newly created pseudo terminal, if necessary.
Since: 2.1.1
data HostCommandStdin Source #
Ways to process std-input.
Since: 1.0.0
HostCommandNoStdin | Disbale std-in |
HostCommandInheritStdin | Inherit std-in |
HostCommandStdInConduit (ConduitT () ByteString IO ()) | Produce std-in |
data HostCommandStdout a where Source #
Ways to process std-output.
Since: 3.1.0
HostCommandStdoutLog :: HostCommandStdout ExitCode | Write std-out to the log sink. |
HostCommandStdoutLogAndCapture :: HostCommandStdout (ByteString, ExitCode) | Write std-out to the log sink, additionally collect and return it. |