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,29 +212,25 @@ 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") { switch runtime.GOARCH {
builder.WriteString("arm") case "amd64":
} else { builder.WriteString("(amd64|x86_64|x64)")
switch runtime.GOARCH { case "386":
case "amd64": builder.WriteString("(386|x86)")
builder.WriteString("(amd64|x86_64|x64)") case "arm":
case "386": builder.WriteString("(armv5|armv7|arm)")
builder.WriteString("(386|x86)") case "arm64":
case "arm": builder.WriteString("arm64")
builder.WriteString("(armv5|armv7|arm)") case "mips":
case "arm64": builder.WriteString("mips")
builder.WriteString("arm64") case "mips64":
case "mips": builder.WriteString("mips64")
builder.WriteString("mips") case "mipsle":
case "mips64": builder.WriteString("(mipsle|mipsel)")
builder.WriteString("mips64") case "mips64le":
case "mipsle": builder.WriteString("(mips64le|mips64el)")
builder.WriteString("(mipsle|mipsel)") default:
case "mips64le": builder.WriteString(runtime.GOARCH)
builder.WriteString("(mips64le|mips64el)")
default:
builder.WriteString(runtime.GOARCH)
}
} }
builder.WriteString("\\.zip") builder.WriteString("\\.zip")