Skip to content

Commit 8f131b3

Browse files
committed
Enhance debug output when api key is absent
Previously if the API key was not, some of the features of exercism cli would not work, for example exercism status. This commit just prompts the user to set their API key to access the full features of exercism cli, when its not set.
1 parent f391cc1 commit 8f131b3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/debug.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ func Debug(ctx *cli.Context) {
6464

6565
if configured {
6666
fmt.Printf("Config file: %s\n", c.File)
67-
fmt.Printf("API Key: %s\n", c.APIKey)
67+
if c.APIKey != "" {
68+
fmt.Printf("API Key: %s\n", c.APIKey)
69+
} else {
70+
fmt.Println("API Key: Please set your API Key to access all of the CLI features")
71+
}
6872
} else {
6973
fmt.Println("Config file: <not configured>")
70-
fmt.Println("API Key: <not configured>")
74+
fmt.Println("API Key: Please set your API Key to access all of the CLI features")
7175
}
7276
fmt.Printf("Exercises Directory: %s\n", c.Dir)
7377

0 commit comments

Comments
 (0)