basic check if a specific commit is in use (#2107)

This commit is contained in:
Oleg Gulevskyy
2022-12-14 23:06:37 +11:00
committed by GitHub
parent 006b0c65b4
commit 6b110c83e9
+7
View File
@@ -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)