mirror of
https://github.com/octoleo/syncthing.git
synced 2024-09-19 05:09:01 +00:00
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:
parent
de64ffddab
commit
a963bc8b86
@ -223,8 +223,8 @@ func readRelease(archiveName, dir, url string) (string, error) {
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
switch runtime.GOOS {
|
switch path.Ext(archiveName) {
|
||||||
case "windows":
|
case ".zip":
|
||||||
return readZip(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))
|
return readZip(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))
|
||||||
default:
|
default:
|
||||||
return readTarGz(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))
|
return readTarGz(archiveName, dir, io.LimitReader(resp.Body, maxArchiveSize))
|
||||||
|
Loading…
Reference in New Issue
Block a user