MCPcopy Create free account
hub / github.com/cli/cli / findCopilotBinary

Function findCopilotBinary

pkg/cmd/copilot/copilot.go:225–235  ·  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

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