win: provider: Detect(): return *.cmd path (#7577)

neovim-ruby-host is a ruby script.
neovim-node-host is a shell script.
Both don't work in cmd.exe so gem and npm provide batchfile shims.

Return the full path of these shims, cmd.exe knows better what to do with these files.
This commit is contained in:
Jan Edmund Lazo 2017-11-17 17:52:51 -05:00 committed by Justin M. Keyes
parent 07931ed1c8
commit e8af34dc63
2 changed files with 11 additions and 7 deletions

View File

@ -6,7 +6,7 @@ let g:loaded_node_provider = 1
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
function! provider#node#Detect() abort
return exepath('neovim-node-host')
return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host')
endfunction
function! provider#node#Prog()
@ -19,6 +19,9 @@ function! provider#node#Require(host) abort
return
endif
if has('win32')
let args = provider#node#Prog()
else
let args = ['node']
if !empty($NVIM_NODE_HOST_DEBUG)
@ -26,6 +29,7 @@ function! provider#node#Require(host) abort
endif
call add(args , provider#node#Prog())
endif
try
let channel_id = jobstart(args, s:job_opts)

View File

@ -19,7 +19,7 @@ function! provider#ruby#Detect() abort
if exists("g:ruby_host_prog")
return g:ruby_host_prog
else
return exepath('neovim-ruby-host')
return has('win32') ? exepath('neovim-ruby-host.cmd') : exepath('neovim-ruby-host')
end
endfunction