From 52d30ac08c9d19f26797e3fa189c1f9036505c89 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Thu, 29 Jul 2021 16:15:45 +0300 Subject: [PATCH] [macOS] Fix xcode installation script if there is only one Xcode version to install (#3808) * Cast xcodeVersions variable to array --- images/macos/provision/core/xcode.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/macos/provision/core/xcode.ps1 b/images/macos/provision/core/xcode.ps1 index 0ce0eb8f..ece967b1 100644 --- a/images/macos/provision/core/xcode.ps1 +++ b/images/macos/provision/core/xcode.ps1 @@ -15,7 +15,7 @@ if ([string]::IsNullOrEmpty($env:XCODE_INSTALL_USER) -or [string]::IsNullOrEmpty $env:SPACESHIP_SKIP_2FA_UPGRADE = 1 $os = Get-OSVersion -$xcodeVersions = Get-ToolsetValue "xcode.versions" +[Array]$xcodeVersions = Get-ToolsetValue "xcode.versions" $defaultXcode = Get-ToolsetValue "xcode.default" [Array]::Reverse($xcodeVersions) $threadCount = "5" @@ -36,8 +36,8 @@ if ($os.IsLessThanCatalina) { $latestXcodeVersion = $xcodeVersions | Select-Object -Last 1 -ExpandProperty link Install-XcodeAdditionalPackages -Version $latestXcodeVersion } -$xcodeVersions | ForEach-Object { - Invoke-XcodeRunFirstLaunch -Version $_.link +$xcodeVersions | ForEach-Object { + Invoke-XcodeRunFirstLaunch -Version $_.link } Invoke-XcodeRunFirstLaunch -Version $defaultXcode