Documentation
¶
Index ¶
- type Executor
- func (e *Executor) AddOutputFilter(substring string) *Executor
- func (e *Executor) Capture() (string, error)
- func (e *Executor) CaptureAndTrim() (string, error)
- func (e *Executor) Run() error
- func (e *Executor) RunWithCode() (int, error)
- func (e *Executor) SetCwd(cwd string) *Executor
- func (e *Executor) SetEnv(env []string) *Executor
- func (e *Executor) SetOutputPrefix(prefix string) *Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶ added in v0.1.0
type Executor struct {
// contains filtered or unexported fields
}
func NewShell ¶ added in v0.1.0
NewShell returns an *Executor that will run the command line in a shell
func (*Executor) AddOutputFilter ¶ added in v0.3.0
AddOutputFilter adds a substring to the list used to suppress lines printed by the command
func (*Executor) Capture ¶ added in v0.1.0
Capture executes the command and return the output and the exit code
func (*Executor) CaptureAndTrim ¶ added in v0.2.0
CaptureAndTrim calls Capture() and trim the blank lines
func (*Executor) Run ¶ added in v0.1.0
Run executes the command. Return an error for non-zero exitcode.
func (*Executor) RunWithCode ¶ added in v0.3.0
RunWithCode executes the command. Return the exit code and an error.
func (*Executor) SetCwd ¶ added in v0.1.0
SetCwd changes the current working directory the command will be run in
func (*Executor) SetEnv ¶ added in v0.2.0
SetEnv changes the environment variables that will be used to run the command
func (*Executor) SetOutputPrefix ¶ added in v0.3.0
SetOutputPrefix sets a prefix for each line printed by the command