fix(ci): fix ci err

This commit is contained in:
sky5454 2026-03-31 05:21:26 +08:00
parent 0b4c26c1db
commit 456791ab32
2 changed files with 9 additions and 6 deletions

View file

@ -70,7 +70,7 @@ func DownloadAndExtractRelease(releaseURL, platform, arch string) (string, error
return "", fmt.Errorf("failed to download asset: status %d", resp.StatusCode)
}
if _, err := io.Copy(tmpFile, resp.Body); err != nil {
if _, err = io.Copy(tmpFile, resp.Body); err != nil {
os.Remove(tmpPath)
return "", err
}
@ -119,7 +119,7 @@ func UpdateSelfFromRelease(releaseURL, platform, arch, programName string) error
// ensure executable bit on non-windows
if runtime.GOOS != "windows" {
_ = os.Chmod(binPath, 0755)
_ = os.Chmod(binPath, 0o755)
}
f, err := os.Open(binPath)
@ -312,7 +312,10 @@ func looksLikeDirectAssetURL(u string) bool {
return false
}
lower := strings.ToLower(u)
if strings.HasSuffix(lower, ".zip") || strings.HasSuffix(lower, ".tar.gz") || strings.HasSuffix(lower, ".tgz") || strings.HasSuffix(lower, ".tar") {
if strings.HasSuffix(lower, ".zip") ||
strings.HasSuffix(lower, ".tar.gz") ||
strings.HasSuffix(lower, ".tgz") ||
strings.HasSuffix(lower, ".tar") {
return true
}
if strings.Contains(lower, "/releases/download/") {