From ff6a3d4b29bd9570f9978264e0531b0ff3620ff5 Mon Sep 17 00:00:00 2001 From: Shamil Mubarakshin <127750046+shamil-mubarakshin@users.noreply.github.com> Date: Thu, 3 Aug 2023 18:20:16 +0200 Subject: [PATCH] [macos] Utilise arch helper function (#8036) --- images/macos/provision/core/xcode.ps1 | 3 +-- images/macos/tests/Xcode.Tests.ps1 | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/images/macos/provision/core/xcode.ps1 b/images/macos/provision/core/xcode.ps1 index a5609e81..634526bc 100644 --- a/images/macos/provision/core/xcode.ps1 +++ b/images/macos/provision/core/xcode.ps1 @@ -7,8 +7,7 @@ Import-Module "$env:HOME/image-generation/helpers/Xcode.Installer.psm1" -Disable # https://github.com/fastlane/fastlane/pull/18116 $env:SPACESHIP_SKIP_2FA_UPGRADE = 1 -$ARCH = arch -if ($ARCH -ne "arm64") { $ARCH = "x64" } +$ARCH = Get-Architecture [Array]$xcodeVersions = Get-ToolsetValue "xcode.$ARCH.versions" write-host $xcodeVersions $defaultXcode = Get-ToolsetValue "xcode.default" diff --git a/images/macos/tests/Xcode.Tests.ps1 b/images/macos/tests/Xcode.Tests.ps1 index a38a996d..5eb49fdb 100644 --- a/images/macos/tests/Xcode.Tests.ps1 +++ b/images/macos/tests/Xcode.Tests.ps1 @@ -2,8 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking -$ARCH = arch -if ($ARCH -ne "arm64") { $ARCH = "x64" } +$ARCH = Get-Architecture $xcodeVersions = Get-ToolsetValue "xcode.$ARCH.versions" $defaultXcode = Get-ToolsetValue "xcode.default" $latestXcodeVersion = $xcodeVersions | Select-Object -First 1