File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ func logoutRun(opts *LogoutOptions) error {
7474
7575 candidates , err := cfg .Hosts ()
7676 if err != nil {
77+ return err
78+ }
79+ if len (candidates ) == 0 {
7780 return fmt .Errorf ("not logged in to any hosts" )
7881 }
7982
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ func refreshRun(opts *RefreshOptions) error {
8383
8484 candidates , err := cfg .Hosts ()
8585 if err != nil {
86+ return err
87+ }
88+ if len (candidates ) == 0 {
8689 return fmt .Errorf ("not logged in to any hosts. Use 'gh auth login' to authenticate with a host" )
8790 }
8891
Original file line number Diff line number Diff line change @@ -69,7 +69,10 @@ func statusRun(opts *StatusOptions) error {
6969 statusInfo := map [string ][]string {}
7070
7171 hostnames , err := cfg .Hosts ()
72- if len (hostnames ) == 0 || err != nil {
72+ if err != nil {
73+ return err
74+ }
75+ if len (hostnames ) == 0 {
7376 fmt .Fprintf (stderr ,
7477 "You are not logged into any GitHub hosts. Run %s to authenticate.\n " , cs .Bold ("gh auth login" ))
7578 return cmdutil .SilentError
You can’t perform that action at this time.
0 commit comments