mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
use hub master if we are in pre-release (#196)
Co-authored-by: AlteredCoder <AlteredCoder>
This commit is contained in:
parent
b7286d6a85
commit
57aa1c6b24
1 changed files with 4 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/mod/semver"
|
||||
)
|
||||
|
||||
func inSlice(s string, slice []string) bool {
|
||||
|
@ -38,6 +39,9 @@ func setHubBranch() error {
|
|||
|
||||
if cwversion.Version == latest {
|
||||
cwhub.HubBranch = "master"
|
||||
} else if semver.Compare(cwversion.Version, latest) == 1 { // if current version is greater than the latest we are in pre-release
|
||||
log.Debugf("Your current crowdsec version seems to be a pre-release (%s)", cwversion.Version)
|
||||
cwhub.HubBranch = "master"
|
||||
} else {
|
||||
log.Warnf("Crowdsec is not the latest version. Current version is '%s' and latest version is '%s'. Please update it!", cwversion.Version, latest)
|
||||
log.Warnf("As a result, you will not be able to use parsers/scenarios/collections added to Crowdsec Hub after CrowdSec %s", latest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue