From 0182da2f83e6e59c72101459dcb0939d80ff5c4e Mon Sep 17 00:00:00 2001 From: Kazuki Okamoto Date: Fri, 5 Feb 2021 04:32:27 +0900 Subject: [PATCH] bump version 4.1 Support 9.0.1. --- ChangeLog.md | 6 ++++++ ghcups.psd1 | 6 +++--- ghcups.psm1 | 13 +++++++++++++ version.yaml | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8091cc3..af4de54 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,11 @@ # Change log +## 4.1 + +*2021.02.05* + +Support 9.0.1. + ## 4.0 *2020.12.31* diff --git a/ghcups.psd1 b/ghcups.psd1 index 43865ff..dddfbac 100644 --- a/ghcups.psd1 +++ b/ghcups.psd1 @@ -12,7 +12,7 @@ RootModule = 'ghcups.psm1' # このモジュールのバージョン番号です。 -ModuleVersion = '4.0' +ModuleVersion = '4.1' # サポートされている PSEditions # CompatiblePSEditions = @() @@ -98,7 +98,7 @@ PrivateData = @{ Tags = @('Haskell', 'GHC', 'PSEdition_Core', 'Windows') # このモジュールのライセンスの URL。 - LicenseUri = 'https://github.com/kakkun61/ghcups/blob/4.0/LICENSE' + LicenseUri = 'https://github.com/kakkun61/ghcups/blob/4.1/LICENSE' # このプロジェクトのメイン Web サイトの URL。 ProjectUri = 'https://github.com/kakkun61/ghcups' @@ -107,7 +107,7 @@ PrivateData = @{ # IconUri = '' # このモジュールの ReleaseNotes - ReleaseNotes = 'https://github.com/kakkun61/ghcups/blob/4.0/ChangeLog.md' + ReleaseNotes = 'https://github.com/kakkun61/ghcups/blob/4.1/ChangeLog.md' ExternalModuleDependencies = @('Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Utility') diff --git a/ghcups.psm1 b/ghcups.psm1 index 8306f63..7d972f5 100644 --- a/ghcups.psm1 +++ b/ghcups.psm1 @@ -346,6 +346,16 @@ function Install-Ghc { 7z x "-o$tempDir$fileName.tar" "$tempDir$fileName.tar.xz" 7z x "-o$(Get-GhcupsInstall)" "$tempDir$fileName.tar" + $metas = Get-HashtaleItem 'ghc', $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) { + Move-Item -Path "$(Get-GhcupsInstall)\$($meta['directory'])" -Destination "$(Get-GhcupsInstall)\ghc-$($meta['version'])" + } + } + if ($Set) { Set-Ghc -Name $Version } @@ -402,6 +412,9 @@ function Get-Ghc { $result.Add($version, @{ 'Supported' = $false; 'Path' = "$(Get-GhcupsInstall)\ghc-$version" }) } foreach ($version in $supporteds) { + if ($version -is [hashtable]) { + $version = $version['version'] + } if ($null -eq $result[$version]) { $result.Add($version, @{ 'Supported' = $true; 'Path' = $null }) } diff --git a/version.yaml b/version.yaml index ec168a5..5a39717 100644 --- a/version.yaml +++ b/version.yaml @@ -1,5 +1,7 @@ ghc: x86_64: + - version: '9.0.1' + directory: ghc-9.0.1-x86_64-unknown-mingw32 - '8.10.3' - '8.10.2' - '8.10.1'