checkGHAuth verifies that the gh CLI is installed and authenticated. Returns true if gh is available.
()
| 26 | // checkGHAuth verifies that the gh CLI is installed and |
| 27 | // authenticated. Returns true if gh is available. |
| 28 | func checkGHAuth() bool { |
| 29 | cmd := exec.Command("gh", "auth", "status") |
| 30 | cmd.Stdout = nil |
| 31 | cmd.Stderr = nil |
| 32 | return cmd.Run() == nil |
| 33 | } |
| 34 | |
| 35 | // ghPR is a minimal pull request representation parsed from gh CLI |
| 36 | // JSON output. |