File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,22 @@ If your CLI is already authenticated this will return information about your ses
2626 }
2727
2828 auth := config .NewAuthenticator (cfg )
29- if ok , err := auth .Check (); err != nil {
29+ ok , err := auth .Check ()
30+ if err != nil {
3031 fmt .Println (err )
3132 os .Exit (1 )
32- } else if ok {
33+ }
34+
35+ if ok {
3336 fmt .Println ("Authenticated" )
34- } else if ! checkOnly {
35- fmt .Println ("Authentication required. Opening browser..." )
36- auth .Authenticate ()
37- } else {
37+ os .Exit (0 )
38+ } else if checkOnly { // If we're only checking, exit with an error.
3839 fmt .Println ("Invalid authentication" )
40+ os .Exit (1 )
3941 }
4042
43+ fmt .Println ("Authentication required. Opening browser..." )
44+ auth .Authenticate ()
4145 if err := config .Store (cfg ); err != nil {
4246 fmt .Println (err )
4347 }
You can’t perform that action at this time.
0 commit comments