aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorObserverOfTime <chronobserver@disroot.org>2019-07-14 21:48:53 +0300
committerJustin M. Keyes <justinkz@gmail.com>2019-07-14 20:48:53 +0200
commitc38862aceabef0d2dc144b407300241875c8b89f (patch)
treefe3e0d2a524462c2e61dae57ffac906be776a0ec
parent452112ae387ca73f8cec52ea0acca5e35b0a60e4 (diff)
downloadrneovim-c38862aceabef0d2dc144b407300241875c8b89f.tar.gz
rneovim-c38862aceabef0d2dc144b407300241875c8b89f.tar.bz2
rneovim-c38862aceabef0d2dc144b407300241875c8b89f.zip
checkhealth: try yarn if npm is missing #10490
fixes #10489
-rw-r--r--runtime/autoload/health/provider.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 29bbee4888..87d82150b6 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -564,7 +564,10 @@ function! s:check_node() abort
endif
call health#report_info('Neovim node.js host: '. host)
- let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json'
+ let manager = executable('npm') ? 'npm' : 'yarn'
+ let latest_npm_cmd = has('win32') ?
+ \ 'cmd /c '. manager .' info neovim --json' :
+ \ manager .' info neovim --json'
let latest_npm = s:system(split(latest_npm_cmd))
if s:shell_error || empty(latest_npm)
call health#report_error('Failed to run: '. latest_npm_cmd,
@@ -593,7 +596,8 @@ function! s:check_node() abort
call health#report_warn(
\ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s',
\ current_npm, latest_npm),
- \ ['Run in shell: npm install -g neovim'])
+ \ ['Run in shell: npm install -g neovim',
+ \ 'Run in shell (if you use yarn): yarn global add neovim'])
else
call health#report_ok('Latest "neovim" npm/yarn package is installed: '. current_npm)
endif