MCPcopy Create free account
hub / github.com/exercism/cli / validateUserConfig

Function validateUserConfig

cmd/cmd.go:68–80  ·  view source on GitHub ↗

validateUserConfig validates the presence of required user config values

(cfg *viper.Viper)

Source from the content-addressed store, hash-verified

66
67// validateUserConfig validates the presence of required user config values
68func validateUserConfig(cfg *viper.Viper) error {
69 if cfg.GetString("token") == "" {
70 return fmt.Errorf(
71 msgWelcomePleaseConfigure,
72 config.TokenURL(cfg.GetString("apibaseurl")),
73 BinaryName,
74 )
75 }
76 if cfg.GetString("workspace") == "" || cfg.GetString("apibaseurl") == "" {
77 return fmt.Errorf(msgRerunConfigure, BinaryName)
78 }
79 return nil
80}
81
82// decodedAPIError decodes and returns the error message from the API response.
83// If the message is blank, it returns a fallback message with the status code.

Callers 2

runSubmitFunction · 0.85
runDownloadFunction · 0.85

Calls 1

TokenURLFunction · 0.92

Tested by

no test coverage detected