mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-16 13:46:42 +00:00
feat(webi): probe zst as unpacker; properly probe formats in webi-pwsh
webi/webi.sh: detect unzstd/zstd alongside the existing git/unxz/ unzip/tar probes. Sends `?formats=...,zst` when zstd is available so the server can pick a .tar.zst build only on hosts that can extract it. webi/webi-pwsh.ps1: replace the hardcoded `formats=zip,exe,tar,git` TODO with real Get-Command probing for git, zstd, and 7z.
This commit is contained in:
@@ -194,8 +194,11 @@ Write-Host "${TTask}Installing${TReset} ${TName}${exename}${TReset}"
|
||||
Write-Host " ${TDim}Fetching install script ...${TReset}"
|
||||
|
||||
$PKG_URL = "$Env:WEBI_HOST/api/installers/$exename.ps1"
|
||||
# TODO detect formats
|
||||
$UrlParams = "formats=zip,exe,tar,git&libc=msvc"
|
||||
$DetectedFormats = @("zip", "exe", "tar")
|
||||
if (Get-Command git -ErrorAction SilentlyContinue) { $DetectedFormats += "git" }
|
||||
if (Get-Command zstd -ErrorAction SilentlyContinue) { $DetectedFormats += "zst" }
|
||||
if (Get-Command 7z -ErrorAction SilentlyContinue) { $DetectedFormats += "7z" }
|
||||
$UrlParams = "formats=$($DetectedFormats -join ',')&libc=msvc"
|
||||
$PkgInstallPwsh = "$HOME\.local\tmp\$exename.install.ps1"
|
||||
Invoke-DownloadUrl -Force -URL $PKG_URL -Params $UrlParams -Path $PkgInstallPwsh
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ __webi_main() {
|
||||
if [ -n "$(command -v git)" ]; then
|
||||
my_ext="git,$my_ext"
|
||||
fi
|
||||
if [ -n "$(command -v unzstd)" ] || [ -n "$(command -v zstd)" ]; then
|
||||
my_ext="zst,$my_ext"
|
||||
fi
|
||||
if [ -n "$(command -v unxz)" ]; then
|
||||
my_ext="xz,$my_ext"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user