-
Notifications
You must be signed in to change notification settings - Fork 4
Add early check for gh default repo in gh wrapper scripts #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| #!/bin/sh | ||
| set -eux | ||
|
|
||
| if ! gh repo set-default --view > /dev/null 2>&1; then | ||
| echo "X No default remote repository has been set." >&2 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jules does this only occur if it needs to be set?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! The |
||
| echo "please run \`gh repo set-default\` to select a default remote repository." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| prerelease_flag="" | ||
| git_tag_inc_args="" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jules does this only occur if it needs to be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! The
gh repo set-default --viewcommand only fails (returns a non-zero exit code) if a default repository hasn't been set yet. If one is already set, it successfully views it and returns 0, so theifblock is skipped and the script continues.