Documentation
¶
Overview ¶
Package execx wraps os/exec behind an interface, so command sequences can be asserted in tests without git, docker or node being installed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
Name string
Args []string
Dir string
Env []string // extra variables, appended to the current environment
Stdin io.Reader
// Stdout, when set, receives the command output instead of it being
// captured in Result (used to stream pg_dump straight to a file).
Stdout io.Writer
// Live mirrors output to the terminal, for long commands like docker build.
Live bool
// Interactive hands the process the terminal itself, so that a shell or
// any prompt-driven command behaves normally. Nothing is captured.
Interactive bool
}
type Error ¶
Error carries the underlying command failure so callers can wrap it with their own context without losing the original message.
type Fake ¶
Fake records commands and replies with whatever Handler returns. It lives in the non-test build so every package can drive its own sequences.