b9-2.0.0: A tool and library for building virtual machine images.

Safe HaskellNone
LanguageHaskell2010

B9.B9Exec

Description

This modules contains support for external command execution.

Since: 0.5.65

Synopsis

Documentation

cmd :: (HasCallStack, Member ExcB9 e, CommandIO e) => String -> Eff e () Source #

Execute the given shell command.

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

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

hostCmdEither Source #

Arguments

:: CommandIO e 
=> HostCommandStdin

A HostCommandStdin to define standard input. If the value is HostCommandInheritStdin then **also stdout and stderr** will be redirected to the Inherited file descriptors.

-> String

The shell command to execute.

-> Maybe Timeout

An optional Timeout

-> 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

hostCmd Source #

Arguments

:: (CommandIO e, Member ExcB9 e) 
=> String

The shell command to execute.

-> Maybe Timeout

An optional Timeout

-> Eff e Bool

An action that performs the shell command and returns True on success

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

hostCmdStdIn Source #

Arguments

:: (CommandIO e, Member ExcB9 e) 
=> HostCommandStdin

A HostCommandStdin to define standard input. If the value is HostCommandInheritStdin then **also stdout and stderr** will be redirected to the Inherited file descriptors.

-> String

The shell command to execute.

-> Maybe Timeout

An optional Timeout

-> Eff e Bool

An action that performs the shell command and returns True on success

Like hostCmd but with std-input attached.

Since: 1.0.0

newtype Timeout Source #

A way to specify a time intervall for example for the timeouts of system commands.

Since: 1.1.0

Constructors

TimeoutMicros Int 
Instances
Eq Timeout Source # 
Instance details

Defined in B9.B9Config

Methods

(==) :: Timeout -> Timeout -> Bool #

(/=) :: Timeout -> Timeout -> Bool #

Ord Timeout Source # 
Instance details

Defined in B9.B9Config

Read Timeout Source # 
Instance details

Defined in B9.B9Config

Show Timeout Source # 
Instance details

Defined in B9.B9Config

Arbitrary Timeout Source # 
Instance details

Defined in B9.B9Config

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