reuse function

This commit is contained in:
Maxim Lobanov
2020-10-06 11:11:36 +03:00
parent 5a999ef791
commit f80d9cdc66
2 changed files with 10 additions and 17 deletions

View File

@@ -46,11 +46,17 @@ function Switch-Xcode {
}
function Test-XcodeStableRelease {
param(
[Parameter(Mandatory)]
param (
[Parameter(ParameterSetName = 'Version')]
[string] $Version,
[Parameter(ParameterSetName = 'Path')]
[string] $XcodeRootPath
)
if ($PSCmdlet.ParameterSetName -eq "Version") {
$XcodeRootPath = Get-XcodeRootPath $Version
}
$licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist"
$releaseType = & defaults read $licenseInfoPlistPath "licenseType"
return -not ($releaseType -match "beta")
@@ -102,17 +108,4 @@ function Get-XcodePairsList {
$result += "$watchName $phoneName"
}
return $result
}
function Test-XcodeStableVersion {
param([Parameter(Mandatory)][string]$Version)
if ($Version -match "beta") {
return $false
}
if ($Version -match "GM") {
return $false
}
return $true
}