[macos] use unxip if available for XCode unpacking (#7992)

This commit is contained in:
ilia-shipitsin
2023-08-07 11:53:07 +02:00
committed by GitHub
parent c493b069d2
commit 4ec9fdae13
4 changed files with 19 additions and 3 deletions

View File

@@ -166,3 +166,12 @@ function Get-Architecture {
return $arch
}
function Test-CommandExists {
param
(
[Parameter(Mandatory)] [string] $Command
)
[boolean] (Get-Command $Command -ErrorAction 'SilentlyContinue')
}

View File

@@ -1,3 +1,4 @@
Import-Module "$PSScriptRoot/Common.Helpers.psm1"
Import-Module "$PSScriptRoot/Xcode.Helpers.psm1"
function Install-XcodeVersion {
@@ -86,7 +87,11 @@ function Expand-XcodeXipArchive {
Write-Host "Extracting Xcode from '$xcodeXipPath'"
Push-Location $DownloadDirectory
Invoke-ValidateCommand "xip -x $xcodeXipPath"
if(Test-CommandExists 'unxip') {
Invoke-ValidateCommand "unxip $xcodeXipPath"
} else {
Invoke-ValidateCommand "xip -x $xcodeXipPath"
}
Pop-Location
if (Test-Path "$DownloadDirectory/Xcode-beta.app") {

View File

@@ -202,7 +202,8 @@
"tcl-tk",
"r",
"yq",
"imagemagick"
"imagemagick",
"unxip"
],
"cask_packages": [
"julia",

View File

@@ -74,7 +74,8 @@
"zstd",
"gmp",
"r",
"yq"
"yq",
"unxip"
],
"cask_packages": [
"julia",