better errors for `gh` when not logged in
right now, the error is not that great when running gh ... being logged out :thinking:
and it does not fail in the sense that the LAST_EXIT_CODE is not set to 1 in that case :thinking:
an idea that looks to be working: add gh auth status at the start
remaining things: what happens when the user is
- [x] logged out: fails with
You are not logged into any GitHub hosts. Run gh auth login to authenticate.- #20
- [ ] logged in: ??? =>
--logged-outoption to query the API withhttp get
right now, the error is not that great when running
gh ...being logged out 🤔 and it does not fail in the sense that theLAST_EXIT_CODEis not set to1in that case 🤔
Ah, rrrhh so many are not following proper exit codes, your option sound like a good one although the command isn't the fastest (at least when logged)
- logged out: fails with
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
I would output the same error verbatim, probably prefix with some "Host Error" or something similar
- logged in: ??? =>
--logged-outoption to query the API withhttp get
I'm not familiar with this flow can you elaborate?
Ah, rrrhh so many are not following proper exit codes, your option sound like a good one although the command isn't the fastest (at least when logged)
yeah, gh auth status takes a bit of time, it's true :thinking:
it's the only thing i've found so far :confused:
I would output the same error verbatim, probably prefix with some "Host Error" or something similar
:+1:
I'm not familiar with this flow can you elaborate?
instead of using gh, you call poll the REST API of GitHub directly :smirk:
see this gist for instance :yum: