[Windows] Refactor PATH helpers (#8885)

This commit is contained in:
Vasilii Polikarpov
2023-11-29 13:00:16 +01:00
committed by GitHub
parent c73276d3f6
commit bfe32a2b12
14 changed files with 179 additions and 191 deletions

View File

@@ -2,7 +2,6 @@
## File: Install-Haskell.ps1
## Desc: Install Haskell for Windows
################################################################################
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
# install minimal ghcup, utilizing pre-installed msys2 at C:\msys64
Write-Host 'Installing ghcup...'
@@ -28,8 +27,7 @@ Start-DownloadWithRetry -Url $ghcupDownloadURL -Name "ghcup.exe" -DownloadPath "
[System.Environment]::SetEnvironmentVariable("CABAL_DIR", $cabalDir, "Machine")
Add-MachinePathItem "$ghcupPrefix\ghcup\bin"
Add-MachinePathItem "$cabalDir\bin"
Update-SessionEnvironment
Update-Environment
# Get 3 latest versions of GHC
$Versions = ghcup list -t ghc -r | Where-Object {$_ -notlike "prerelease"}