Skip to content

Commit

Permalink
support Cabal 3.4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkun61 committed May 19, 2021

Verified

This commit was signed with the committer’s verified signature.
daviehh daviehh
1 parent 16980c6 commit fb5bdf5
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ghcups.psm1
Original file line number Diff line number Diff line change
@@ -554,6 +554,18 @@ function Install-Cabal {
$tempDir = [System.IO.Path]::GetTempPath()
$arch = Get-Architecture
$fileName = "cabal-install-$Version-$arch-unknown-mingw32.zip"

$metas = Get-HashtaleItem 'cabal', $arch (Get-Config "$($MyInvocation.MyCommand.Module.ModuleBase)\version.yaml")
foreach ($meta in $metas) {
if ($meta -eq $Version) {
break
}
if ($meta -is [hashtable] -and $meta['version'] -eq $Version) {
$fileName = $meta['archive-file']
break
}
}

if (Test-Path "$tempDir$fileName") {
Write-Host "A downloaded archive file is found: $tempDir$fileName"
$choice = Read-Host "Do you want to use this? [y/N]"
@@ -608,10 +620,10 @@ function Get-Cabal {
$userGlobalConfig = Get-Config (Join-Path $userGlobalDataPath $globalConfigName)
$systemGlobalConfig = Get-Config (Join-Path $systemGlobalDataPath $globalConfigName)
$config = Join-Hashtables $localConfig, $userGlobalConfig, $systemGlobalConfig
$paths = if ($OnlySupported) { $null } else {Get-HashtaleItem 'cabal' $config }
$paths = if ($OnlySupported) { $null } else { Get-HashtaleItem 'cabal' $config }
$installeds = Get-InstalledItems 'cabal'
$arch = Get-Architecture
$supporteds = Get-HashtaleItem 'cabal', $arch (Get-Config "$($MyInvocation.MyCommand.Module.ModuleBase)\version.yaml")
$supporteds = Get-HashtaleItem 'cabal', $arch (Get-Config "$($MyInvocation.MyCommand.Module.ModuleBase)\version.yaml") | ForEach-Object { if ($_ -is [hashtable]) { $_['version'] } else { $_ } }

if ($HumanReadable) {
if ($null -ne $paths) {
2 changes: 2 additions & 0 deletions version.yaml
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@ ghc:
- '8.0.1'
cabal:
x86_64:
- version: '3.4.0.0'
archive-file: cabal-install-3.4.0.0-x86_64-windows.zip
- '3.2.0.0'
- '3.0.0.0'
- '2.4.1.0'

0 comments on commit fb5bdf5

Please sign in to comment.