File tree Expand file tree Collapse file tree 1 file changed +37
-10
lines changed Expand file tree Collapse file tree 1 file changed +37
-10
lines changed Original file line number Diff line number Diff line change 1+ # !/usr/bin/env pwsh
2+
13$version = ' 0.1.145'
24$name = ' languageclient'
35$url = " https://github.com/autozimu/LanguageClient-neovim/releases/download/$version /$name -$version -"
46
5- if ($ENV: PROCESSOR_ARCHITECTURE -eq ' AMD64' ) {
6- $url += ' x86_64'
7- } else {
8- $url += ' i686'
9- }
7+ $path = " $PSScriptRoot \bin\$name "
108
11- $url += ' -pc-windows-gnu.exe'
9+ switch ($true ) {
10+ $IsMacOS {
11+ # MacOS is always x86_64
12+ $url += ' x86_64-apple-darwin'
13+ }
14+ $IsLinux {
15+ # Detecting architecture is more involved on Linux
16+ $arch = uname - sm
17+ $url += switch ($arch ) {
18+ ' Linux x86_64' { ' x86_64' }
19+ ' Linux i686' { ' i686' }
20+ ' Linux aarch64' { ' aarch64' }
21+ Default { throw ' architecture not supported' }
22+ }
23+ $url += ' -unknown-linux-musl'
24+ }
25+ Default {
26+ # Windows
27+ $url += if ([Environment ]::Is64BitOperatingSystem) { ' x86_64' } else { ' i686' }
28+ $url += ' -pc-windows-gnu.exe'
29+
30+ # We need to tack on the .exe to the end of the download path
31+ $path += ' .exe'
32+ }
33+ }
1234
13- $path = " $PSScriptRoot \bin\$name .exe"
14- if (Test-Path $path ) {
15- Remove-Item - Force $path
35+ if (Test-Path - LiteralPath $path ) {
36+ Remove-Item - Force - LiteralPath $path
1637}
38+
1739echo " Downloading $url ..."
18- [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
40+
41+ if (! $IsCoreCLR ) {
42+ # We only need to do this for Windows PowerShell
43+ [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
44+ }
45+
1946Invoke-WebRequest - Uri $url - OutFile $path
You can’t perform that action at this time.
0 commit comments