From 57a08bac71edeea90bfa48d6496782dfafb41f78 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Sun, 18 Oct 2020 20:52:32 +0300 Subject: [PATCH] add correct path to install haskell --- images/win/scripts/Installers/Install-Haskell.ps1 | 3 ++- images/win/scripts/Tests/Haskell.Tests.ps1 | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/images/win/scripts/Installers/Install-Haskell.ps1 b/images/win/scripts/Installers/Install-Haskell.ps1 index 50c0c6d4..18b256a3 100644 --- a/images/win/scripts/Installers/Install-Haskell.ps1 +++ b/images/win/scripts/Installers/Install-Haskell.ps1 @@ -17,7 +17,8 @@ ForEach ($version in $VersionsList) # Add default version of GHC to path, because choco formula updates path on user level $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 Write-Host "Installing cabal..." diff --git a/images/win/scripts/Tests/Haskell.Tests.ps1 b/images/win/scripts/Tests/Haskell.Tests.ps1 index 53a0bf6c..38a558de 100644 --- a/images/win/scripts/Tests/Haskell.Tests.ps1 +++ b/images/win/scripts/Tests/Haskell.Tests.ps1 @@ -9,7 +9,8 @@ Describe "Haskell" { $ghcVersion = $_ $ghcShortVersion = ([version]$ghcVersion).ToString(3) @{ - ghcVersion = $ghcShortVersion + ghcVersion = $ghcVersion + ghcShortVersion = $ghcShortVersion binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe" } } @@ -19,11 +20,11 @@ Describe "Haskell" { } It "GHC is installed" -TestCases $ghcTestCases { - "$binGhcPath --version" | Should -MatchCommandOutput $ghcVersion + "$binGhcPath --version" | Should -MatchCommandOutput $ghcShortVersion } - It "GHC is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcShortVersion} { - "ghc --version" | Should -MatchCommandOutput $defaultGhcVersion + It "GHC is the default version and should be the latest installed" -TestCases @{defaultGhcShortVersion = $defaultGhcShortVersion} { + "ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion } It "Cabal is installed" {