Skip to content

Commit 7c660d3

Browse files
committed
config: nag user if API url or key are not configured
1 parent c2e55b9 commit 7c660d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ func main() {
3232
c := config.NewConfig(configFileName, homeDirectory, configType)
3333
api := mite.NewApi(c.GetApiUrl(), c.GetApiKey(), v.Version)
3434

35+
if c.GetApiUrl() == "" {
36+
_, _ = fmt.Fprintln(os.Stderr, "please configure your API url by executing: 'mite config api.url=<your mite api url>'")
37+
}
38+
39+
if c.GetApiKey() == "" {
40+
_, _ = fmt.Fprintln(os.Stderr, "please configure your API key by executing: 'mite config api.key=<your mite api key>'")
41+
}
42+
3543
err = cmd.HandleCommands(c, api, v)
3644
if err != nil {
3745
_, _ = fmt.Fprintln(os.Stderr, err)

0 commit comments

Comments
 (0)