Skip to content

Commit

Permalink
minor fix: better check for beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Utesgui authored Oct 14, 2024
1 parent ced14c8 commit 5da050c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ function Get-LatestMongoDBVersions {

$versions = $Packagelinks | ForEach-Object { $_ -match '(\d+\.\d+\.\d+(-rc\d*|-beta\d*)?)' | Out-Null; $matches[1] }
$stableVersions = $versions | Where-Object { $_ -notmatch '(-rc|beta)' }

$latestVersion = $stableVersions | Sort-Object { [Version]$_ } | Select-Object -Last 1
$latestVersionUrl = $Packagelinks | Where-Object { $_ -match $latestVersion }
$latestVersionUrls = $Packagelinks | Where-Object { $_ -match $latestVersion }

# remove -beta versions from URLs
$latestVersionUrl = $latestVersionUrls | Where-Object { $_ -notmatch 'beta' }

return @{
Version = $latestVersion
Expand Down

0 comments on commit 5da050c

Please sign in to comment.