From 1b3d575b0ff5606698424ac12b3b9fa5f61f2d56 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 8 Nov 2023 00:35:22 -0700 Subject: [PATCH] fix(windows): include User-Agent MS so that alias installs work in dev --- archiver/install.ps1 | 2 +- git-gpg-init/install.ps1 | 2 +- gpg-pubkey/install.ps1 | 2 +- ripgrep/install.ps1 | 2 +- trippy/install.ps1 | 2 +- webi/webi-pwsh.ps1 | 2 +- zig.vim/install.ps1 | 2 +- ziglang/install.ps1 | 2 +- zoxide/install.ps1 | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/archiver/install.ps1 b/archiver/install.ps1 index f7ac884..e551bbe 100644 --- a/archiver/install.ps1 +++ b/archiver/install.ps1 @@ -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 diff --git a/git-gpg-init/install.ps1 b/git-gpg-init/install.ps1 index 8e90807..23eb658 100644 --- a/git-gpg-init/install.ps1 +++ b/git-gpg-init/install.ps1 @@ -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 diff --git a/gpg-pubkey/install.ps1 b/gpg-pubkey/install.ps1 index 2abc72b..1a3a48a 100644 --- a/gpg-pubkey/install.ps1 +++ b/gpg-pubkey/install.ps1 @@ -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 "" diff --git a/ripgrep/install.ps1 b/ripgrep/install.ps1 index 485355f..c0ba350 100644 --- a/ripgrep/install.ps1 +++ b/ripgrep/install.ps1 @@ -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 diff --git a/trippy/install.ps1 b/trippy/install.ps1 index a60305c..8195755 100644 --- a/trippy/install.ps1 +++ b/trippy/install.ps1 @@ -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 diff --git a/webi/webi-pwsh.ps1 b/webi/webi-pwsh.ps1 index a724344..48548c1 100644 --- a/webi/webi-pwsh.ps1 +++ b/webi/webi-pwsh.ps1 @@ -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 .ps1 powershell .\.local\tmp\$exename.install.ps1 diff --git a/zig.vim/install.ps1 b/zig.vim/install.ps1 index 6807a4f..7922ce6 100644 --- a/zig.vim/install.ps1 +++ b/zig.vim/install.ps1 @@ -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 diff --git a/ziglang/install.ps1 b/ziglang/install.ps1 index 2563bb5..b3a003f 100644 --- a/ziglang/install.ps1 +++ b/ziglang/install.ps1 @@ -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 diff --git a/zoxide/install.ps1 b/zoxide/install.ps1 index 5a11663..3335952 100644 --- a/zoxide/install.ps1 +++ b/zoxide/install.ps1 @@ -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" }