forked from liuchengxu/vim-clap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
27 lines (19 loc) · 811 Bytes
/
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
#!/usr/bin/env pwsh
$version = 'v0.54'
$APP = 'maple'
$url = "https://github.com/liuchengxu/vim-clap/releases/download/$version/$APP-"
$output = "$PSScriptRoot\bin\$APP.exe"
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
if ([Environment]::Is64BitOperatingSystem) {
$url += 'x86_64-pc-windows-msvc'
} else {
echo 'No prebuilt maple binary for 32-bit Windows system'
Exit 1
}
if (Test-Path -LiteralPath $output) {
Remove-Item -Force -LiteralPath $output
}
echo "Downloading $url, please wait a second......"
$start_time = Get-Date
(New-Object System.Net.WebClient).DownloadFile($url, $output)
Write-Output "Download the maple binary successfully, time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"