Skip to content

Commit

Permalink
feat(env): allow nodejs path to be set by the environment (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheeldotme authored Jun 19, 2020
1 parent f00e036 commit d66d82e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autoload/coc/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function! coc#util#job_command()
if (has_key(g:, 'coc_node_path'))
let node = expand(g:coc_node_path)
else
let node = 'node'
let node = $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH
endif
if !executable(node)
echohl Error | echom '[coc.nvim] "'.node.'" is not executable, checkout https://nodejs.org/en/download/' | echohl None
Expand Down
2 changes: 1 addition & 1 deletion autoload/health/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function! s:checkEnvironment() abort
let valid = 0
call health#report_error('Neovim version not satisfied, 0.3.0 and above required')
endif
let node = get(g:, 'coc_node_path', 'node')
let node = get(g:, 'coc_node_path', $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH)
if !executable(node)
let valid = 0
call health#report_error('Executable node.js not found, install node.js from http://nodejs.org/')
Expand Down
2 changes: 1 addition & 1 deletion plugin/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function! s:ShowInfo()
else
let lines = []
echomsg 'coc.nvim service not started, checking environment...'
let node = get(g:, 'coc_node_path', 'node')
let node = get(g:, 'coc_node_path', $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH)
if !executable(node)
call add(lines, 'Error: '.node.' is not executable!')
else
Expand Down

0 comments on commit d66d82e

Please sign in to comment.