accept proposal

This commit is contained in:
Maxim Lobanov
2020-11-11 14:33:35 +03:00
parent c656a9ddf2
commit 1aad4c7b8d
2 changed files with 3 additions and 6 deletions

View File

@@ -42,7 +42,6 @@ function Get-XcodeVersionInfo {
}
}
function Switch-Xcode {
param (
[Parameter(ParameterSetName = 'Version')]

View File

@@ -53,11 +53,9 @@ function Resolve-ExactXcodeVersion {
function Get-AvailableXcodeVersions {
$rawVersionsList = & xcversion list | ForEach-Object { $_.Trim() } | Where-Object { $_ -match "^\d" }
$availableVersions = $rawVersionsList | ForEach-Object {
$parts = $_.Split(" ", 2)
$stableSemver = [SemVer]::Parse($parts[0])
if ($parts.Count -eq 1) {
$semver = $stableSemver
} else {
$partStable,$partMajor = $_.Split(" ", 2)
$semver = $stableSemver = [SemVer]::Parse($partStable)
if ($partMajor) {
# Convert 'beta 3' -> 'beta.3', 'Release Candidate' -> 'releasecandidate', 'GM Seed 2' -> 'gmseed.2'
$normalizedLabel = $parts[1].toLower() -replace " (\d)", '.$1' -replace " ([a-z])", '$1'
$semver = [SemVer]::new($stableSemver.Major, $stableSemver.Minor, $stableSemver.Patch, $normalizedLabel)