don't try to login with zero scenarios (#627)

This commit is contained in:
Thibault "bui" Koechlin 2021-02-18 09:59:28 +01:00 committed by GitHub
parent 22ada59393
commit 4565d82f79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,6 +132,9 @@ func NewCapiCmd() *cobra.Command {
if err != nil {
log.Fatalf("failed to get scenarios : %s", err.Error())
}
if len(scenarios) == 0 {
log.Fatalf("no scenarios installed, abort")
}
Client, err = apiclient.NewDefaultClient(apiurl, CAPIURLPrefix, fmt.Sprintf("crowdsec/%s", cwversion.VersionStr()), nil)
if err != nil {