fix(picker.db): better script to download sqlite3 on windows. See #918

This commit is contained in:
Folke Lemaitre 2025-02-04 17:19:14 +01:00
parent 9c2df14a55
commit 84d1a92fab
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -31,13 +31,20 @@ local function sqlite3_lib()
"powershell", "powershell",
"-Command", "-Command",
[[ [[
$url = "]] .. url .. [["; $url = "]] .. url .. [[";
$zipPath = "$env:TEMP\sqlite.zip"; $zipPath = "$env:TEMP\sqlite.zip";
$extractPath = "$env:TEMP\sqlite"; $extractPath = "$env:TEMP\sqlite";
Invoke-WebRequest -Uri $url -OutFile $zipPath; Invoke-WebRequest -Uri $url -OutFile $zipPath;
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force; Add-Type -AssemblyName System.IO.Compression.FileSystem;
Move-Item -Path "$extractPath\sqlite3.dll" -Destination "]] .. sqlite_path .. [[" -Force [System.IO.Compression.ZipFile]::ExtractToDirectory($zipPath, $extractPath);
]],
$dllPath = "$extractPath\sqlite3.dll";
if (Test-Path $dllPath) {
Move-Item -Path $dllPath -Destination "]] .. sqlite_path .. [[" -Force;
} else {
Write-Host "sqlite3.dll not found at $dllPath";
}
]],
}) })
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
Snacks.notify.error("Failed to download `sqlite3.dll`:\n" .. out) Snacks.notify.error("Failed to download `sqlite3.dll`:\n" .. out)