diff --git a/webi/webi-pwsh.ps1 b/webi/webi-pwsh.ps1 index 752b178..49f9d3d 100755 --- a/webi/webi-pwsh.ps1 +++ b/webi/webi-pwsh.ps1 @@ -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 diff --git a/webi/webi.sh b/webi/webi.sh index beaabc6..c077eae 100755 --- a/webi/webi.sh +++ b/webi/webi.sh @@ -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