MCPcopy Create free account
hub / github.com/google/gapid / Call

Method Call

core/os/shell/command.go:176–181  ·  view source on GitHub ↗

Call executes the command, capturing its output. This is a helper for the common case where you want to run a command, capture all its output into a string and see if it succeeded.

(ctx context.Context)

Source from the content-addressed store, hash-verified

174// This is a helper for the common case where you want to run a command, capture all its output into a string and
175// see if it succeeded.
176func (cmd Cmd) Call(ctx context.Context) (string, error) {
177 buf := &muxedBuffer{}
178 err := cmd.Capture(buf, buf).Run(ctx)
179 output := strings.TrimSpace(buf.buf.String())
180 return output, err
181}
182
183func (cmd Cmd) Format(f fmt.State, c rune) {
184 fmt.Fprint(f, cmd.Name)

Callers 5

buildFunction · 0.95
traceFunction · 0.95
reportFunction · 0.95
linearizeFunction · 0.95
captureStatsFunction · 0.95

Calls 3

CaptureMethod · 0.95
RunMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected