()
| 15 | * stdout: 'ignore' so the token never enters this process. |
| 16 | */ |
| 17 | export async function getGhAuthStatus(): Promise<GhAuthStatus> { |
| 18 | const ghPath = await which('gh') |
| 19 | if (!ghPath) { |
| 20 | return 'not_installed' |
| 21 | } |
| 22 | const { exitCode } = await execa('gh', ['auth', 'token'], { |
| 23 | stdout: 'ignore', |
| 24 | stderr: 'ignore', |
| 25 | timeout: 5000, |
| 26 | reject: false, |
| 27 | }) |
| 28 | return exitCode === 0 ? 'authenticated' : 'not_authenticated' |
| 29 | } |
| 30 |
no outgoing calls
no test coverage detected