From 6341547de6465c455eda65f033cf93eee41bda85 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Wed, 8 Feb 2023 20:30:16 +0300 Subject: [PATCH] [macOS] prepare helpers for macOS 13 (#7071) --- images/macos/helpers/Common.Helpers.psm1 | 1 + images/macos/provision/utils/utils.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/images/macos/helpers/Common.Helpers.psm1 b/images/macos/helpers/Common.Helpers.psm1 index 0dbe23831..3fa9d56fc 100644 --- a/images/macos/helpers/Common.Helpers.psm1 +++ b/images/macos/helpers/Common.Helpers.psm1 @@ -34,6 +34,7 @@ function Get-OSVersion { IsCatalina = $osVersionMajorMinor -eq "10.15" IsBigSur = $osVersion.Version.Major -eq "11" IsMonterey = $osVersion.Version.Major -eq "12" + IsVentura = $osVersion.Version.Major -eq "13" IsLessThanMonterey = $osVersion.Version.Major -lt "12" IsHigherThanCatalina = $osVersion.Version.Major -ge "11" } diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 737102e07..b499b22fd 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -39,6 +39,14 @@ download_with_retries() { return 1 } +is_Ventura() { + if [ "$OSTYPE" = "darwin22" ]; then + true + else + false + fi +} + is_Monterey() { if [ "$OSTYPE" = "darwin21" ]; then true @@ -114,6 +122,8 @@ get_brew_os_keyword() { echo "big_sur" elif is_Monterey; then echo "monterey" + elif is_Ventura; then + echo "ventura" else echo "null" fi @@ -147,7 +157,7 @@ should_build_from_source() { # Use the '--build-from-source' option to build from source in this case brew_smart_install() { local tool_name=$1 - + local os_name=$(get_brew_os_keyword) if [[ "$os_name" == "null" ]]; then echo "$OSTYPE is unknown operating system"