Skip to content

Commit 115c0bc

Browse files
committed
Warn in case of invalid configuration
1 parent 824e813 commit 115c0bc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/root.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ We take care while you do what you do best.`,
7373
// Extract project, token, endpoint
7474
cfg.Path = cfgpaths[len(cfgpaths)-1]
7575
globalConfiguration = cfg
76+
77+
// Warn if either project, token or endpoint is empty
78+
if len(globalConfiguration.Token()) == 0 || len(globalConfiguration.Endpoint()) == 0 || len(globalConfiguration.Project()) == 0 {
79+
fmt.Fprintln(os.Stderr, "Warning: Active context is invalid. Choose or configure a new context using the `valar config` command.")
80+
}
7681
return nil
7782
},
7883
}

0 commit comments

Comments
 (0)