MCPcopy Index your code
hub / github.com/ddev/ddev / HostCommand

Function HostCommand

pkg/exec/exec.go:46–53  ·  view source on GitHub ↗

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

(name string, args ...string)

Source from the content-addressed store, hash-verified

44// HostCommand wraps RunCommand() to inject environment variables.
45// especially DDEV_EXECUTABLE, the full path to running DDEV instance.
46func HostCommand(name string, args ...string) *exec.Cmd {
47 c := exec.Command(name, args...)
48 ddevExecutable, _ := os.Executable()
49 c.Env = append(os.Environ(),
50 "DDEV_EXECUTABLE="+ddevExecutable,
51 )
52 return c
53}
54
55// RunCommand runs a command on the host system.
56// returns the stdout of the command and an err

Callers 7

RunCommandFunction · 0.85
RunCommandPipeFunction · 0.85
RunInteractiveCommandFunction · 0.85
RunHostCommandFunction · 0.85

Calls 1

CommandMethod · 0.80

Tested by

no test coverage detected