From a963bc8b861b75e9e7c77cc8ba7673a4581c1513 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 16 Dec 2019 07:21:18 +0100 Subject: [PATCH] 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.) --- lib/upgrade/upgrade_supported.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/upgrade/upgrade_supported.go b/lib/upgrade/upgrade_supported.go index ec8dc7e1d..7d723b7f8 100644 --- a/lib/upgrade/upgrade_supported.go +++ b/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))