forked from odedniv/.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installnvim.ps1
42 lines (38 loc) · 1.36 KB
/
installnvim.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
#!/bin/bash -
#===============================================================================
#
# FILE: installnvim.sh
#
# USAGE: ./installnvim.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: YOUR NAME (),
# ORGANIZATION:
# CREATED: 10/21/2019 19:01
# REVISION: ---
#===============================================================================
$ErrorActionPreference = "Stop" # Treat errors as terminating errors
function Exit-OnError {
param($exit_code, $last_command)
if ($exit_code -ne 0) {
Write-Error "`"$last_command`" command failed with exit code $exit_code."
exit $exit_code
}
}
Write-Host "usage: new-version-zip-filename (ie nightly)"
Remove-Item -Path nvim-win64.tar.gz -ErrorAction Ignore
Invoke-WebRequest -Uri ("https://github.com/neovim/neovim/releases/download/" + $args[0] + "/nvim-win64.tar.gz") -OutFile nvim-win64.tar.gz
Exit-OnError $LASTEXITCODE $LASTCOMMAND
if (Test-Path -Path nvim-temp) {
Write-Host "moving temp to last temp"
Remove-Item -Path ./neovim-lasttemp -ErrorAction Ignore
Move-Item -Path nvim-temp -Destination nvim-lasttemp
}
Move-Item -Path nvim-osx64 -Destination nvim-temp
Expand-Archive -Path nvim-win64.tar.gz -DestinationPath ./ -Force
#mv $2 nvim-osx64