MCPcopy Index your code
hub / github.com/coder/coder / ghOutput

Function ghOutput

scripts/releaser/github.go:13–24  ·  view source on GitHub ↗

ghOutput runs a gh CLI command and returns trimmed stdout.

(args ...string)

Source from the content-addressed store, hash-verified

11
12// ghOutput runs a gh CLI command and returns trimmed stdout.
13func ghOutput(args ...string) (string, error) {
14 cmd := exec.Command("gh", args...)
15 out, err := cmd.Output()
16 if err != nil {
17 var exitErr *exec.ExitError
18 if errors.As(err, &exitErr) {
19 return "", exitErr
20 }
21 return "", err
22 }
23 return strings.TrimSpace(string(out)), nil
24}
25
26// checkGHAuth verifies that the gh CLI is installed and
27// authenticated. Returns true if gh is available.

Callers 4

ghListOpenPRsFunction · 0.85
ghListPRsWithLabelFunction · 0.85
ghBuildPRMetadataMapFunction · 0.85
updateReleaseDocsFunction · 0.85

Calls 3

CommandMethod · 0.80
AsMethod · 0.80
OutputMethod · 0.65

Tested by

no test coverage detected