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

Function RunHostCommandSeparateStreams

pkg/exec/exec.go:178–190  ·  view source on GitHub ↗

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

(command string, args ...string)

Source from the content-addressed store, hash-verified

176// RunHostCommandSeparateStreams executes a command on the host and returns the
177// stdout and error
178func RunHostCommandSeparateStreams(command string, args ...string) (string, error) {
179 if globalconfig.DdevVerbose {
180 output.UserOut.Printf("RunHostCommandSeparateStreams: %s %v", command, strings.Join(args, " "))
181 }
182 c := HostCommand(command, args...)
183 c.Stdin = os.Stdin
184 o, err := c.Output()
185 if globalconfig.DdevVerbose {
186 output.UserOut.Printf("RunHostCommandSeparateStreams returned output=%v, err=%v", string(o), err)
187 }
188
189 return string(o), err
190}
191
192// CleanAndCopy removes control characters from output
193func CleanAndCopy(dst io.Writer, src io.Reader) error {

Callers 7

mutagenSyncSessionExistsFunction · 0.92
MutagenStatusMethod · 0.92
TestDebugGobDecodeCmdFunction · 0.92
TestDebugRemoteDataCmdFunction · 0.92
TestJSONValidationFunction · 0.92
TestCmdVersionFunction · 0.92

Calls 1

HostCommandFunction · 0.85

Tested by 5

TestDebugGobDecodeCmdFunction · 0.74
TestDebugRemoteDataCmdFunction · 0.74
TestJSONValidationFunction · 0.74
TestCmdVersionFunction · 0.74