Fix #895 - Run Node.js scripts with node.exe instead of node on Windows

This commit is contained in:
w0rp
2017-08-31 13:12:24 +01:00
parent 1d86a724f2
commit 7c2a5052a8
12 changed files with 48 additions and 52 deletions

View File

@@ -11,16 +11,8 @@ endfunction
function! ale#fixers#standard#Fix(buffer) abort
let l:executable = ale#fixers#standard#GetExecutable(a:buffer)
if ale#Has('win32') && l:executable =~? 'cmd\.js$'
" For Windows, if we detect an standard.js script, we need to execute
" it with node, or the file can be opened with a text editor.
let l:head = 'node ' . ale#Escape(l:executable)
else
let l:head = ale#Escape(l:executable)
endif
return {
\ 'command': l:head
\ 'command': ale#node#Executable(a:buffer, l:executable)
\ . ' --fix %t',
\ 'read_temporary_file': 1,
\}