MCPcopy Index your code
hub / github.com/cli/cli / findCopilotBinary

Function findCopilotBinary

pkg/cmd/copilot/copilot.go:224–234  ·  view source on GitHub ↗

findCopilotBinary returns the path to the Copilot CLI binary, if installed, with the following order of precedence: 1. `copilot` in the PATH 2. `copilot` in gh's data directory If not installed, it returns an empty string.

()

Source from the content-addressed store, hash-verified

222//
223// If not installed, it returns an empty string.
224func findCopilotBinary() string {
225 if path, err := exec.LookPath(copilotBinaryName); err == nil {
226 return path
227 }
228
229 localPath := copilotBinaryPath()
230 if _, err := os.Stat(localPath); err != nil {
231 return ""
232 }
233 return localPath
234}
235
236// downloadCopilot downloads and installs the Copilot CLI to installDir.
237// It returns the path to the installed Copilot binary.

Callers

nothing calls this directly

Calls 1

copilotBinaryPathFunction · 0.85

Tested by

no test coverage detected