fix(copilot): provide full path to copilot binary on exec error

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
This commit is contained in:
Babak K. Shandiz 2026-05-12 12:24:29 +01:00 committed by GitHub
parent 601dd346b0
commit ae7bd54d43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -183,10 +183,10 @@ func runCopilot(opts *CopilotOptions) error {
os.Exit(exitErr.ExitCode())
}
if foundInPath {
// The binary exists in PATH but exec failed, possibly due to
// We found a `copilot` binary but exec failed, possibly due to
// unusual characters in the path (see https://github.com/cli/cli/issues/13106).
// Suggest running copilot directly as a workaround.
return fmt.Errorf("%w\nTry running `copilot` directly without `gh`.", err)
return fmt.Errorf("%w\nFailed to run '%s', try running `copilot` directly without `gh`.", err, copilotPath)
}
return err
}