Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyCommand ¶
PrettyCommand takes arguments identical to Cmder.Command, it returns a pretty printed command that could be pasted into a shell
func RunCommandOutputToFileFunc ¶
RunCommandOutputToFileFunc returns a func that runs the given Cmd pipes its stdout to the file specified. If the file does not exist on the host, it will be created
Types ¶
type Cmd ¶
type Cmd interface { // Run executes the command (like os/exec.Cmd.Run) // It returns a *RunError if there is any error, nil otherwise Run() *RunError // WithEnv sets the Env variables for the Cmd // Each entry should be of the form "key=value" WithEnv(...string) Cmd // WithStdin sets the io.Reader used for stdin WithStdin(reader io.Reader) Cmd // WithStdout sets the io.Writer used for stdout WithStdout(io.Writer) Cmd // WithStderr sets the io.Reader used for stderr WithStderr(io.Writer) Cmd }
Cmd abstracts over running a command somewhere
type LocalCmd ¶
LocalCmd wraps os/exec.Cmd, implementing the cmdutils.Cmd interface
func (*LocalCmd) Run ¶
Run runs the command If the returned error is non-nil, it should be of type *RunError
func (*LocalCmd) WithStderr ¶
WithStderr sets stderr
type RunError ¶
type RunError struct {
// contains filtered or unexported fields
}
RunError represents an error running a Cmd
func (*RunError) OutputString ¶
func (*RunError) PrettyCommand ¶
PrettyCommand pretty prints the command in a way that could be pasted into a shell
Click to show internal directories.
Click to hide internal directories.