MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / runExecutable

Function runExecutable

test/integration/integrationtestutil.go:64–77  ·  view source on GitHub ↗

Returns string(stdout), string(stderr), error It is a particularly bad idea to run this on something that outputs loads and loads of std output over time as we'll consume heaps of memory, but we aren't doing that in our integration tests. NOTE: the standard out

(executable string, args []string, workingDirectory string, environment []string)

Source from the content-addressed store, hash-verified

62// our integration tests.
63// NOTE: the standard out
64func runExecutable(executable string, args []string, workingDirectory string, environment []string) (stdout string, stderr string, err error) {
65 stdoutBytes, stderrBytes, err := runExecutableRawOutput(executable, args, workingDirectory, environment)
66 if stdoutBytes != nil {
67 stdout = string(stdoutBytes)
68 } else {
69 stdout = ""
70 }
71 if stderrBytes != nil {
72 stderr = string(stderrBytes)
73 } else {
74 stderr = ""
75 }
76 return
77}
78
79// Runs the CLI but returns raw byte output for stdout and stderr. Typically you want to call runExecutable which returns strings instead
80func runExecutableRawOutput(executable string, args []string, workingDirectory string, environment []string) (stdout []byte, stderr []byte, err error) {

Callers 2

EnsureCliFunction · 0.85
RunCliFunction · 0.85

Calls 1

runExecutableRawOutputFunction · 0.85

Tested by

no test coverage detected