| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
B9.B9Exec
Description
This modules contains support for external command execution.
Since: 0.5.65
Synopsis
- cmd :: CommandIO e => String -> Eff e ()
- hostCmdEither :: forall e. CommandIO e => HostCommandStdin -> String -> Maybe CommandTimeout -> Eff e (Either CommandTimeout ExitCode)
- hostCmd :: (CommandIO e, Member ExcB9 e) => String -> Maybe CommandTimeout -> Eff e Bool
- hostCmdStdIn :: (CommandIO e, Member ExcB9 e) => HostCommandStdin -> String -> Maybe CommandTimeout -> Eff e Bool
- data CommandTimeout = CommandTimeout Int
- data HostCommandStdin
Documentation
cmd :: 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: 0.5.65
Arguments
| :: CommandIO e | |
| => HostCommandStdin | A |
| -> String | The shell command to execute. |
| -> Maybe CommandTimeout | An optional |
| -> Eff e (Either CommandTimeout 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
Arguments
| :: (CommandIO e, Member ExcB9 e) | |
| => String | The shell command to execute. |
| -> Maybe CommandTimeout | 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
Arguments
| :: (CommandIO e, Member ExcB9 e) | |
| => HostCommandStdin | A |
| -> String | The shell command to execute. |
| -> Maybe CommandTimeout | 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
data CommandTimeout Source #
Constructors
| CommandTimeout Int |
Instances
| Show CommandTimeout Source # | |
Defined in B9.B9Exec Methods showsPrec :: Int -> CommandTimeout -> ShowS # show :: CommandTimeout -> String # showList :: [CommandTimeout] -> ShowS # | |
data HostCommandStdin Source #
Ways to process std-input.
Since: 1.0.0
Constructors
| HostCommandNoStdin | Disbale std-in |
| HostCommandInheritStdin | Inherit std-in |
| HostCommandStdInConduit (ConduitT () ByteString IO ()) | Produce std-in |