fix macOS arm64 version update check error

This commit is contained in:
tickstep 2024-03-17 19:48:09 +08:00
parent 02b6d529d0
commit 280421fd88

View File

@ -212,9 +212,6 @@ func CheckUpdate(version string, yes bool) {
builder := &strings.Builder{} builder := &strings.Builder{}
builder.WriteString(ReleaseName + "-" + releaseInfo.TagName + "-" + runtime.GOOS + "-.*?") builder.WriteString(ReleaseName + "-" + releaseInfo.TagName + "-" + runtime.GOOS + "-.*?")
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
builder.WriteString("arm")
} else {
switch runtime.GOARCH { switch runtime.GOARCH {
case "amd64": case "amd64":
builder.WriteString("(amd64|x86_64|x64)") builder.WriteString("(amd64|x86_64|x64)")
@ -235,7 +232,6 @@ func CheckUpdate(version string, yes bool) {
default: default:
builder.WriteString(runtime.GOARCH) builder.WriteString(runtime.GOARCH)
} }
}
builder.WriteString("\\.zip") builder.WriteString("\\.zip")
exp := regexp.MustCompile(builder.String()) exp := regexp.MustCompile(builder.String())