dev/standards (#4)
Reviewed-on: #4 Co-authored-by: jake <jake.young.dev@gmail.com> Co-committed-by: jake <jake.young.dev@gmail.com>
This commit is contained in:
@@ -58,9 +58,10 @@ var loginCmd = &cobra.Command{
|
||||
},
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
//ensure config command has been run
|
||||
if viper.Get("server") == "" || viper.Get("password") == "" || viper.Get("port") == 0 {
|
||||
if !viper.IsSet("server") || !viper.IsSet("password") || !viper.IsSet("port") {
|
||||
return errors.New("the 'config' command must be run before you can interact with servers")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user