ignore the v prefix when comparing the tag and the current version

This commit is contained in:
Gani Georgiev 2023-05-21 13:00:12 +03:00
parent 5551f8f5aa
commit cbaca91581
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"path"
"path/filepath"
"runtime"
"strings"
"github.com/fatih/color"
"github.com/pocketbase/pocketbase/core"
@ -137,7 +138,7 @@ func (p *plugin) update(withBackup bool) error {
return err
}
if p.currentVersion >= latest.Tag {
if strings.TrimPrefix(p.currentVersion, "v") >= strings.TrimPrefix(latest.Tag, "v") {
color.Green("You already have the latest PocketBase %s.", p.currentVersion)
return nil
}