check for disabled issues in issue view command

This commit is contained in:
vilmibm 2020-01-21 15:37:42 -06:00
parent 50a89564a7
commit fc25a4e9ed
2 changed files with 39 additions and 0 deletions

View file

@ -215,6 +215,14 @@ func issueView(cmd *cobra.Command, args []string) error {
return err
}
issuesEnabled, err := api.HasIssuesEnabled(apiClient, baseRepo)
if err != nil {
return err
}
if !issuesEnabled {
return fmt.Errorf("the '%s/%s' repository has disabled issues", baseRepo.RepoOwner(), baseRepo.RepoName())
}
issue, err := issueFromArg(apiClient, baseRepo, args[0])
if err != nil {
return err