Skip to content

Commit

Permalink
Sort by version in advance (actions#3411)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketimofeev authored May 19, 2021
1 parent c60f540 commit 0bac903
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-Haskell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Get 3 latest versions of GHC
[Version[]] $ChocoVersionsOutput = & choco search ghc --allversions | Where-Object { $_.StartsWith('ghc ') -and $_ -match 'Approved' } | ForEach-Object { [regex]::matches($_, '\d+(\.\d+){2,}').value }
$MajorMinorGroups = $ChocoVersionsOutput | Group-Object { $_.ToString(2) } | Sort-Object Name -Descending | Select-Object -First 3
$MajorMinorGroups = $ChocoVersionsOutput | Sort-Object -Descending | Group-Object { $_.ToString(2) } | Select-Object -First 3
$VersionsList = $MajorMinorGroups | ForEach-Object { $_.Group | Select-Object -First 1 } | Sort-Object

# The latest version will be installed as a default
Expand Down

0 comments on commit 0bac903

Please sign in to comment.