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:
2025-04-19 05:13:53 +00:00
committed by jake
parent 35fb9fc270
commit a3527d3388
5 changed files with 19 additions and 25 deletions

View File

@@ -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
},
}