Skip to content

Commit

Permalink
fix: throw error for non-existing org / repo with non-zero status in …
Browse files Browse the repository at this point in the history
…repo list (cli#7240)
  • Loading branch information
wingkwong authored Mar 28, 2023
1 parent 2f0bc86 commit 1f0e533
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cmd/repo/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ func listRun(opts *ListOptions) error {
return err
}

if opts.Owner != "" && listResult.Owner == "" && !listResult.FromSearch {
return fmt.Errorf("the owner handle %q was not recognized as either a GitHub user or an organization", opts.Owner)
}

if err := opts.IO.StartPager(); err != nil {
fmt.Fprintf(opts.IO.ErrOut, "error starting pager: %v\n", err)
}
Expand Down

0 comments on commit 1f0e533

Please sign in to comment.