From 6b110c83e978ae5cee5a8a45b009f1fedc77c185 Mon Sep 17 00:00:00 2001 From: Oleg Gulevskyy <43781031+OlegGulevskyy@users.noreply.github.com> Date: Wed, 14 Dec 2022 13:06:37 +0100 Subject: [PATCH] basic check if a specific commit is in use (#2107) --- v2/internal/gomod/gomod.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v2/internal/gomod/gomod.go b/v2/internal/gomod/gomod.go index c38e60f0..2a07bbf7 100644 --- a/v2/internal/gomod/gomod.go +++ b/v2/internal/gomod/gomod.go @@ -2,6 +2,7 @@ package gomod import ( "fmt" + "strings" "github.com/Masterminds/semver" "golang.org/x/mod/modfile" @@ -39,6 +40,12 @@ func GoModOutOfSync(goModData []byte, currentVersion string) (bool, error) { return false, fmt.Errorf("Unable to find Wails in go.mod") } + // check if a specific patch is targetted by a commit + // i.e. - v2.2.1-0.20221117091924-a8bbce6a126b + if strings.Contains(gomodversion.Original(), "-") { + return false, nil + } + result, err := semver.NewVersion(currentVersion) if err != nil || result == nil { return false, fmt.Errorf("Unable to parse Wails version: %s", currentVersion)