Skip to content

Commit 24913b1

Browse files
committed
don't fail on tags that fail to parse as semver
1 parent 4e88dc4 commit 24913b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

updater/scripts/sort-versions.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ function GetComparableVersion([Parameter(Mandatory = $true)][string] $value)
1010
try {
1111
[System.Management.Automation.SemanticVersion]::Parse($value)
1212
} catch {
13-
Write-Error "Failed to parse semantic version '$value': $_"
13+
Write-Warning "Failed to parse semantic version '$value': $_"
14+
$null
1415
}
1516
}
1617

17-
$List | Sort-Object -Property @{Expression = { GetComparableVersion $_ } }
18+
$List `
19+
| Where-Object { $null -ne (GetComparableVersion $_) } `
20+
| Sort-Object -Property @{Expression = { GetComparableVersion $_ } }

0 commit comments

Comments
 (0)