GODT-1795: fix automatic installation of profile for AppleMail on macOS Ventura beta (qt 5).

This commit is contained in:
Xavier Michelon
2022-08-25 11:02:16 +02:00
committed by Jakub Cuth
parent b3f8866ef7
commit 0d25c607e7
2 changed files with 17 additions and 4 deletions

View File

@ -24,18 +24,24 @@ import (
"github.com/Masterminds/semver/v3"
)
// IsCatalinaOrNewer checks whether the host is MacOS Catalina 10.15.x or higher.
// IsCatalinaOrNewer checks whether the host is macOS Catalina 10.15.x or higher.
func IsCatalinaOrNewer() bool {
return isThisDarwinNewerOrEqual(getMinCatalina())
}
// IsBigSurOrNewer checks whether the host is MacOS BigSur 10.16.x or higher.
// IsBigSurOrNewer checks whether the host is macOS BigSur 10.16.x or higher.
func IsBigSurOrNewer() bool {
return isThisDarwinNewerOrEqual(getMinBigSur())
}
// IsVenturaOrNewer checks whether the host is macOS BigSur 13.x or higher.
func IsVenturaOrNewer() bool {
return isThisDarwinNewerOrEqual(getMinVentura())
}
func getMinCatalina() *semver.Version { return semver.MustParse("19.0.0") }
func getMinBigSur() *semver.Version { return semver.MustParse("20.0.0") }
func getMinVentura() *semver.Version { return semver.MustParse("22.0.0") }
func isThisDarwinNewerOrEqual(minVersion *semver.Version) bool {
if runtime.GOOS != "darwin" {