all: Mac OS X is now called macOS

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4694
LGTM: imsodin
This commit is contained in:
Jakob Borg
2018-01-27 09:07:19 +00:00
parent e0931e201e
commit 050f9f8091
7 changed files with 65 additions and 16 deletions

View File

@@ -225,15 +225,20 @@ func versionParts(v string) ([]int, []interface{}) {
return release, prerelease
}
func releaseName(tag string) string {
func releaseNames(tag string) []string {
// We must ensure that the release asset matches the expected naming
// standard, containing both the architecture/OS and the tag name we
// expect. This protects against malformed release data potentially
// tricking us into doing a downgrade.
switch runtime.GOOS {
case "darwin":
return fmt.Sprintf("syncthing-macosx-%s-%s.", runtime.GOARCH, tag)
return []string{
fmt.Sprintf("syncthing-macos-%s-%s.", runtime.GOARCH, tag),
fmt.Sprintf("syncthing-macosx-%s-%s.", runtime.GOARCH, tag),
}
default:
return fmt.Sprintf("syncthing-%s-%s-%s.", runtime.GOOS, runtime.GOARCH, tag)
return []string{
fmt.Sprintf("syncthing-%s-%s-%s.", runtime.GOOS, runtime.GOARCH, tag),
}
}
}