exec

package
v1.24.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAndCopy added in v1.23.0

func CleanAndCopy(dst io.Writer, src io.Reader) error

CleanAndCopy removes control characters from output

func HostCommand added in v1.22.0

func HostCommand(name string, args ...string) *exec.Cmd

HostCommand wraps RunCommand() to inject environment variables. especially DDEV_EXECUTABLE, the full path to running DDEV instance.

func RunCommand

func RunCommand(command string, args []string) (string, error)

RunCommand runs a command on the host system. returns the stdout of the command and an err

func RunCommandPipe

func RunCommandPipe(command string, args []string) (string, error)

RunCommandPipe runs a command on the host system Returns combined output as string, and error

func RunHostCommand added in v1.21.5

func RunHostCommand(command string, args ...string) (string, error)

RunHostCommand executes a command on the host and returns the combined stdout/stderr results and error

func RunHostCommandSeparateStreams added in v1.21.5

func RunHostCommandSeparateStreams(command string, args ...string) (string, error)

RunHostCommandSeparateStreams executes a command on the host and returns the stdout and error

func RunHostCommandWithOptions added in v1.24.8

func RunHostCommandWithOptions(command string, options []CmdOption, args ...string) (string, error)

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

func RunInteractiveCommand(command string, args []string) error

RunInteractiveCommand runs a command on the host system interactively, with stdin/stdout/stderr connected Returns error

func RunInteractiveCommandWithOutput added in v1.23.0

func RunInteractiveCommandWithOutput(command string, args []string, output io.Writer) error

RunInteractiveCommandWithOutput writes to the host and also to the passed io.Writer

Types

type CmdOption added in v1.24.8

type CmdOption func(*exec.Cmd)

CmdOption is a function type for configuring exec.Cmd

func WithEnv added in v1.24.8

func WithEnv(env []string) CmdOption

WithEnv sets the environment variables for the host command

func WithStdin added in v1.24.8

func WithStdin(stdin io.Reader) CmdOption

WithStdin sets the stdin for the host command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL