fix(windows): include User-Agent MS so that alias installs work in dev

This commit is contained in:
AJ ONeal
2023-11-08 00:35:22 -07:00
parent c2f100d940
commit 1b3d575b0f
9 changed files with 9 additions and 9 deletions

View File

@@ -2,4 +2,4 @@
Write-Output "'archiver@$Env:WEBI_TAG' is an alias for 'arc@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/arc@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/arc@$Env:WEBI_VERSION" | powershell

View File

@@ -2,4 +2,4 @@
Write-Output "'git-gpg-init@$Env:WEBI_TAG' is an alias for 'git-config-gpg@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/git-config-gpg@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/git-config-gpg@$Env:WEBI_VERSION" | powershell

View File

@@ -27,7 +27,7 @@ Set-Content -Path "$Env:USERPROFILE\.local\bin\$MY_CMD.bat" -Value "@echo off`r`
$gpg_exists = Get-Command gpg 2> $null
if (!$gpg_exists) {
curl.exe "$Env:WEBI_HOST/gpg" | powershell
curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_HOST/api/installers/gpg.ps1?formats=zip,exe,tar&libc=msvc" | powershell
$gpg_exists = Get-Command gpg 2> $null
if (!$gpg_exists) {
Write-Output ""

View File

@@ -1,3 +1,3 @@
Write-Output "'ripgrep@$Env:WEBI_TAG' is an alias for 'rg@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/rg@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/rg@$Env:WEBI_VERSION" | powershell

View File

@@ -2,4 +2,4 @@
Write-Output "'trippy@$Env:WEBI_TAG' is an alias for 'trip@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/trip@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/trip@$Env:WEBI_VERSION" | powershell

View File

@@ -103,7 +103,7 @@ if ($exename -eq "-V" -or $exename -eq "--version" -or $exename -eq "version" -o
$PKG_URL = "$Env:WEBI_HOST/api/installers/$exename.ps1?formats=zip,exe,tar,git&libc=msvc"
Write-Output "Downloading $PKG_URL"
# Invoke-WebRequest -UserAgent "Windows amd64" "$PKG_URL" -OutFile ".\.local\tmp\$exename.install.ps1"
& curl.exe -fsSL -A "$Env:WEBI_UA" "$PKG_URL" -o .\.local\tmp\$exename.install.ps1
& curl.exe -A MS -fsSL -A "$Env:WEBI_UA" "$PKG_URL" -o .\.local\tmp\$exename.install.ps1
# Run <whatever>.ps1
powershell .\.local\tmp\$exename.install.ps1

View File

@@ -2,4 +2,4 @@
Write-Output "'zig.vim@$Env:WEBI_TAG' is an alias for 'vim-zig@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/vim-zig@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/vim-zig@$Env:WEBI_VERSION" | powershell

View File

@@ -2,4 +2,4 @@
Write-Output "'ziglang@$Env:WEBI_TAG' is an alias for 'zig@$Env:WEBI_VERSION'"
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -fsSL "$Env:WEBI_HOST/zig@$Env:WEBI_VERSION" | powershell
curl.exe -A MS -fsSL "$Env:WEBI_HOST/zig@$Env:WEBI_VERSION" | powershell

View File

@@ -21,7 +21,7 @@ $pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
# Fetch archive
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
Write-Output "Downloading zoxide from $Env:WEBI_PKG_URL to $pkg_download"
& curl.exe -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
& curl.exe -A MS -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
& Move-Item "$pkg_download.part" "$pkg_download"
}