mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-07 12:18:10 +00:00
fix(picker.db): better script to download sqlite3 on windows. See #918
This commit is contained in:
parent
9c2df14a55
commit
84d1a92fab
1 changed files with 14 additions and 7 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue