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.
()
| 222 | // |
| 223 | // If not installed, it returns an empty string. |
| 224 | func 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. |
nothing calls this directly
no test coverage detected