fix(server): exclude tags from version check (#382)

This commit is contained in:
ze0s 2022-07-29 15:21:55 +02:00 committed by GitHub
parent 6196dcaab9
commit ab8f25d56f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 1 deletions

View file

@ -65,7 +65,7 @@ func (c *Checker) get(ctx context.Context) (*Release, error) {
}
func (c *Checker) CheckNewVersion(ctx context.Context, version string) (bool, string, error) {
if version == "dev" {
if isDevelop(version) {
return false, "", nil
}
@ -99,3 +99,15 @@ func (c *Checker) checkNewVersion(version string, release *Release) (bool, strin
return false, "", nil
}
func isDevelop(version string) bool {
tags := []string{"dev", "develop", "master", "latest"}
for _, tag := range tags {
if version == tag {
return true
}
}
return false
}