File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,8 @@ Download other people's solutions by providing the UUID.
50
50
51
51
func runDownload (cfg config.Config , flags * pflag.FlagSet , args []string ) error {
52
52
usrCfg := cfg .UserViperConfig
53
- if usrCfg .GetString ("token" ) == "" {
54
- return fmt .Errorf (msgWelcomePleaseConfigure , config .SettingsURL (usrCfg .GetString ("apibaseurl" )), BinaryName )
55
- }
56
- if usrCfg .GetString ("workspace" ) == "" || usrCfg .GetString ("apibaseurl" ) == "" {
57
- return fmt .Errorf (msgRerunConfigure , BinaryName )
53
+ if err := validateUserConfig (usrCfg ); err != nil {
54
+ return err
58
55
}
59
56
60
57
uuid , err := flags .GetString ("uuid" )
Original file line number Diff line number Diff line change @@ -51,12 +51,8 @@ var submitCmd = &cobra.Command{
51
51
func runSubmit (cfg config.Config , flags * pflag.FlagSet , args []string ) error {
52
52
usrCfg := cfg .UserViperConfig
53
53
54
- if usrCfg .GetString ("token" ) == "" {
55
- return fmt .Errorf (msgWelcomePleaseConfigure , config .SettingsURL (usrCfg .GetString ("apibaseurl" )), BinaryName )
56
- }
57
-
58
- if usrCfg .GetString ("workspace" ) == "" {
59
- return fmt .Errorf (msgRerunConfigure , BinaryName )
54
+ if err := validateUserConfig (usrCfg ); err != nil {
55
+ return err
60
56
}
61
57
62
58
for i , arg := range args {
You can’t perform that action at this time.
0 commit comments