From 42af27d16c655754639d5b8ad308835277e74426 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Mon, 8 Jul 2024 13:43:22 +0800 Subject: [PATCH] fix(sqlite): Fix compatibility with Windows PowerShell (#6045) --- CHANGELOG.md | 6 ++++++ lib/database.ps1 | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1af1cac..f125069a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [Unreleased](https://github.com/ScoopInstaller/Scoop/compare/master...develop) + +### Bug Fixes + +- **sqlite:** Fix compatibility with Windows PowerShell ([#6045](https://github.com/ScoopInstaller/Scoop/issues/6045)) + ## [v0.5.0](https://github.com/ScoopInstaller/Scoop/compare/v0.4.2...v0.5.0) - 2024-07-01 ### Features diff --git a/lib/database.ps1 b/lib/database.ps1 index ae45f46d..912db11c 100644 --- a/lib/database.ps1 +++ b/lib/database.ps1 @@ -21,15 +21,14 @@ function Get-SQLite { # Install SQLite try { Write-Host "Downloading SQLite $Version..." -ForegroundColor DarkYellow - $sqlitePkgPath = "$env:TEMP\sqlite.nupkg" + $sqlitePkgPath = "$env:TEMP\sqlite.zip" $sqliteTempPath = "$env:TEMP\sqlite" $sqlitePath = "$PSScriptRoot\..\supporting\sqlite" Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/stub.system.data.sqlite.core.netframework/$version/stub.system.data.sqlite.core.netframework.$version.nupkg" -OutFile $sqlitePkgPath Write-Host "Extracting SQLite $Version..." -ForegroundColor DarkYellow -NoNewline Expand-Archive -Path $sqlitePkgPath -DestinationPath $sqliteTempPath -Force New-Item -Path $sqlitePath -ItemType Directory -Force | Out-Null - Move-Item -Path "$sqliteTempPath\build\net45\*" -Destination $sqlitePath -Exclude '*.targets' -Force - Move-Item -Path "$sqliteTempPath\lib\net45\System.Data.SQLite.dll" -Destination $sqlitePath -Force + Move-Item -Path "$sqliteTempPath\build\net451\*", "$sqliteTempPath\lib\net451\System.Data.SQLite.dll" -Destination $sqlitePath -Force Remove-Item -Path $sqlitePkgPath, $sqliteTempPath -Recurse -Force Write-Host ' Done' -ForegroundColor DarkYellow return $true