]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(getscript): GLVS plugin fails with wget.exe with PowerShell
authorMuraoka Taro <koron.kaoriya@gmail.com>
Sat, 20 Dec 2025 18:13:18 +0000 (18:13 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 20 Dec 2025 18:13:18 +0000 (18:13 +0000)
Problem:  Only Windows: The GLVS plugin fails in a PowerShell Desktop if
          wget.exe is installed. The PowerShell Desktop has an alias
          called wget which hides wget.exe.
Solution: Force .exe extension if wget.exe is available.

closes: #18987

Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/getscript.vim

index 1e3b5b39d680bfb658a9a606438bc1d945c760f2..27a5a495359c592fc3cd2b7a109b62d8cae6dd4c 100644 (file)
@@ -14,6 +14,7 @@
 "   2024 Nov 12 by Vim Project: fix problems on Windows (#16036)
 "   2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
 "   2025 May 11 by Vim Project: check network connectivity (#17249)
+"   2025 Dec 21 by Vim Project: make the wget check more robust (#18987)
 "  }}}
 "
 " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@@ -58,7 +59,10 @@ endif
 
 " wget vs curl {{{2
 if !exists("g:GetLatestVimScripts_wget")
- if executable("wget")
+ if executable("wget.exe")
+  " enforce extension: windows powershell desktop version has a wget alias that hides wget.exe
+  let g:GetLatestVimScripts_wget= "wget.exe"
+ elseif executable("wget")
   let g:GetLatestVimScripts_wget= "wget"
  elseif executable("curl.exe")
   " enforce extension: windows powershell desktop version has a curl alias that hides curl.exe
@@ -73,7 +77,7 @@ endif
 
 " options that wget and curl require:
 if !exists("g:GetLatestVimScripts_options")
- if g:GetLatestVimScripts_wget == "wget"
+ if g:GetLatestVimScripts_wget =~ "wget"
   let g:GetLatestVimScripts_options= "-q -O"
  elseif g:GetLatestVimScripts_wget =~ "curl"
   let g:GetLatestVimScripts_options= "-s -o"