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.)
This commit is contained in:
Jakob Borg 2019-12-16 07:21:18 +01:00 committed by GitHub
parent de64ffddab
commit a963bc8b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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))