Skip to content

Conversation

@choldgraf
Copy link
Member

This adds a check for whether the gh cli is installed before trying to use it

@choldgraf
Copy link
Member Author

cc @stefanv I think this would be a more helpful error in case it's not installed, sorry about that!

)
# We can't use this without auth because we hit rate limits immediately
if not auth:
raise ValueError(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very helpful message, thanks!

except FileNotFoundError:
print(
(
"gh cli not found, so will not use it for auth. To download, "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's the implication here that the user should install gh?
Maybe the auth checks should be printed one by one, to show what's happening under the hood.

Either way, this is an improvement, so 👍

@choldgraf choldgraf changed the title Add check for installed gh cli MAINT: Add check for installed gh cli Aug 9, 2022
@choldgraf choldgraf merged commit 08b6dfb into master Aug 9, 2022
@bsipocz bsipocz deleted the gh-check branch September 9, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants