Skip to content

Commit

Permalink
Merge pull request #3 from TylerLeonhardt/add-mac-support
Browse files Browse the repository at this point in the history
Add mac support back
  • Loading branch information
Yatao Li authored Apr 18, 2019
2 parents 092158d + d7d6508 commit 3167b34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion autoload/coc/pses.vim
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
let s:root = expand('<sfile>:h:h:h')
let s:is_win = has('win32') || has('win64')
let s:is_mac = !s:is_win && !has('win32unix')
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
\ (!isdirectory('/proc') && executable('sw_vers')))
let s:is_vim = !has('nvim')
let s:install_script = s:root.'/'.(s:is_win ? 'install.cmd' : 'install.ps1')

if(s:is_mac)
let s:install_script = 'pwsh '.s:install_script
endif

function! coc#pses#install()
let cwd = getcwd()
exe 'lcd '.s:root
exe '!'.s:install_script
exe 'lcd '.cwd
endfunction

6 changes: 5 additions & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ if (!$IsCoreCLR) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
}

# Fail on anything
$ErrorActionPreference = "Stop"
# Progress doesn't display properly in vim
$ProgressPreference = "SilentlyContinue"

$repo = "PowerShell/PowerShellEditorServices"
$file = "PowerShellEditorServices.zip"

Expand All @@ -17,7 +21,7 @@ $tag = (Invoke-RestMethod $releases)[0].tag_name
$download = "https://github.com/$repo/releases/download/$tag/$file"
$zip = "pses.zip"

New-Item -Name $dir -ItemType Directory -Force
$null = New-Item -Name $dir -ItemType Directory -Force
Write-Host Downloading $tag
Invoke-WebRequest $download -OutFile $zip

Expand Down

0 comments on commit 3167b34

Please sign in to comment.