HostCommand wraps RunCommand() to inject environment variables. especially DDEV_EXECUTABLE, the full path to running DDEV instance.
(name string, args ...string)
| 44 | // HostCommand wraps RunCommand() to inject environment variables. |
| 45 | // especially DDEV_EXECUTABLE, the full path to running DDEV instance. |
| 46 | func 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 |
no test coverage detected