Skip to content

Commit

Permalink
Warn in case of invalid configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lnsp committed Dec 19, 2021
1 parent 824e813 commit 115c0bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ We take care while you do what you do best.`,
// Extract project, token, endpoint
cfg.Path = cfgpaths[len(cfgpaths)-1]
globalConfiguration = cfg

// Warn if either project, token or endpoint is empty
if len(globalConfiguration.Token()) == 0 || len(globalConfiguration.Endpoint()) == 0 || len(globalConfiguration.Project()) == 0 {
fmt.Fprintln(os.Stderr, "Warning: Active context is invalid. Choose or configure a new context using the `valar config` command.")
}
return nil
},
}
Expand Down

0 comments on commit 115c0bc

Please sign in to comment.