Documentation
¶
Index ¶
- func CleanAndCopy(dst io.Writer, src io.Reader) error
- func HostCommand(name string, args ...string) *exec.Cmd
- func RunCommand(command string, args []string) (string, error)
- func RunCommandPipe(command string, args []string) (string, error)
- func RunHostCommand(command string, args ...string) (string, error)
- func RunHostCommandSeparateStreams(command string, args ...string) (string, error)
- func RunHostCommandWithOptions(command string, options []CmdOption, args ...string) (string, error)
- func RunInteractiveCommand(command string, args []string) error
- func RunInteractiveCommandWithCapture(command string, args []string) (string, error)
- func RunInteractiveCommandWithOutput(command string, args []string, out io.Writer) error
- type CmdOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAndCopy ¶ added in v1.23.0
CleanAndCopy removes control characters from output
func HostCommand ¶ added in v1.22.0
HostCommand wraps RunCommand() to inject environment variables. especially DDEV_EXECUTABLE, the full path to running DDEV instance.
func RunCommand ¶
RunCommand runs a command on the host system. returns the stdout of the command and an err
func RunCommandPipe ¶
RunCommandPipe runs a command on the host system Returns combined output as string, and error
func RunHostCommand ¶ added in v1.21.5
RunHostCommand executes a command on the host and returns the combined stdout/stderr results and error
func RunHostCommandSeparateStreams ¶ added in v1.21.5
RunHostCommandSeparateStreams executes a command on the host and returns the stdout and error
func RunHostCommandWithOptions ¶ added in v1.24.8
RunHostCommandWithOptions executes a command on the host with configurable options and returns the combined stdout/stderr results and error
func RunInteractiveCommand ¶ added in v1.4.0
RunInteractiveCommand runs a command on the host system interactively, with stdin/stdout/stderr connected Returns error
func RunInteractiveCommandWithCapture ¶ added in v1.25.4
RunInteractiveCommandWithCapture runs a command interactively like RunInteractiveCommand(), but also returns a copy of what it printed, so a failure can be reported with its output attached. stdout and stderr are captured into separate buffers, each written by its own os/exec copy goroutine, so callers that rely on stderr staying off stdout (exec-host hooks piping DDEV's stderr, for instance) see the same separation as RunInteractiveCommand().
func RunInteractiveCommandWithOutput ¶ added in v1.23.0
RunInteractiveCommandWithOutput connects stdin and writes the command's combined output to the passed io.Writer, line by line with ANSI color codes removed. Nothing goes to the terminal unless out writes there.