소스 검색

lib/upgrade: Let Mac load .zip archives (#6230)

There is no need to do this switch based on the current OS, instead do
it based on what the archive actually appears to be.

(Tested; works.)
Jakob Borg 5 년 전
부모
커밋
a963bc8b86
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lib/upgrade/upgrade_supported.go

+ 2 - 2
lib/upgrade/upgrade_supported.go

@@ -223,8 +223,8 @@ func readRelease(archiveName, dir, url string) (string, error) {
 	}
 	defer resp.Body.Close()
 
-	switch runtime.GOOS {
-	case "windows":
+	switch path.Ext(archiveName) {
+	case ".zip":
 		return readZip(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))
 	default:
 		return readTarGz(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))