add correct path to install haskell

This commit is contained in:
Mikhail Timofeev
2020-10-18 20:52:32 +03:00
parent 1d84a5ea79
commit 57a08bac71
2 changed files with 7 additions and 5 deletions

View File

@@ -17,7 +17,8 @@ ForEach ($version in $VersionsList)
# Add default version of GHC to path, because choco formula updates path on user level # Add default version of GHC to path, because choco formula updates path on user level
$DefaultGhcVersion = $VersionsList | Select-Object -Last 1 $DefaultGhcVersion = $VersionsList | Select-Object -Last 1
$DefaultGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$DefaultGhcVersion\tools\ghc-$DefaultGhcVersion\bin" $DefaultGhcShortVersion = ([version]$DefaultGhcVersion).ToString(3)
$DefaultGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$DefaultGhcVersion\tools\ghc-$DefaultGhcShortVersion\bin"
Add-MachinePathItem -PathItem $DefaultGhcPath Add-MachinePathItem -PathItem $DefaultGhcPath
Write-Host "Installing cabal..." Write-Host "Installing cabal..."

View File

@@ -9,7 +9,8 @@ Describe "Haskell" {
$ghcVersion = $_ $ghcVersion = $_
$ghcShortVersion = ([version]$ghcVersion).ToString(3) $ghcShortVersion = ([version]$ghcVersion).ToString(3)
@{ @{
ghcVersion = $ghcShortVersion ghcVersion = $ghcVersion
ghcShortVersion = $ghcShortVersion
binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe" binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe"
} }
} }
@@ -19,11 +20,11 @@ Describe "Haskell" {
} }
It "GHC <ghcVersion> is installed" -TestCases $ghcTestCases { It "GHC <ghcVersion> is installed" -TestCases $ghcTestCases {
"$binGhcPath --version" | Should -MatchCommandOutput $ghcVersion "$binGhcPath --version" | Should -MatchCommandOutput $ghcShortVersion
} }
It "GHC <defaultGhcVersion> is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcShortVersion} { It "GHC <defaultGhcVersion> is the default version and should be the latest installed" -TestCases @{defaultGhcShortVersion = $defaultGhcShortVersion} {
"ghc --version" | Should -MatchCommandOutput $defaultGhcVersion "ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion
} }
It "Cabal is installed" { It "Cabal is installed" {