forked from autozimu/LanguageClient-neovim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
executable file
·46 lines (38 loc) · 1.23 KB
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env pwsh
$version = '0.1.161'
$name = 'languageclient'
$url = "https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/$name-$version-"
$path = "$PSScriptRoot\bin\$name"
switch ($true) {
$IsMacOS {
# MacOS is always x86_64
$url += 'x86_64-apple-darwin'
}
$IsLinux {
# Detecting architecture is more involved on Linux
$arch = uname -sm
$url += switch ($arch) {
'Linux x86_64' { 'x86_64' }
'Linux i686' { 'i686' }
'Linux aarch64' { 'aarch64' }
Default { throw 'architecture not supported' }
}
$url += '-unknown-linux-musl'
}
Default {
# Windows
$url += if ([Environment]::Is64BitOperatingSystem) { 'x86_64' } else { 'i686' }
$url += '-pc-windows-gnu.exe'
# We need to tack on the .exe to the end of the download path
$path += '.exe'
}
}
if (Test-Path -LiteralPath $path) {
Remove-Item -Force -LiteralPath $path
}
echo "Downloading $url ..."
if (!$IsCoreCLR) {
# We only need to do this for Windows PowerShell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
}
Invoke-WebRequest -Uri $url -OutFile $path