diff options
author | dundargoc <gocdundar@gmail.com> | 2024-04-02 12:36:13 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-06 16:42:26 +0200 |
commit | 9dd112dd4821a325a6c1c8d952a537f42f9c728c (patch) | |
tree | 02d59fe023762ef90c1e93c17dd602095c5195dc /runtime/lua/provider/node | |
parent | 7560aee59547c3b050c3ee9988dd0e4d36d00144 (diff) | |
download | rneovim-9dd112dd4821a325a6c1c8d952a537f42f9c728c.tar.gz rneovim-9dd112dd4821a325a6c1c8d952a537f42f9c728c.tar.bz2 rneovim-9dd112dd4821a325a6c1c8d952a537f42f9c728c.zip |
refactor: remove fn_bool
It's better to use vim.fn directly instead of creating minor
abstractions like fn_bool.
Diffstat (limited to 'runtime/lua/provider/node')
-rw-r--r-- | runtime/lua/provider/node/health.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/lua/provider/node/health.lua b/runtime/lua/provider/node/health.lua index a434f8a92b..b4dca2f482 100644 --- a/runtime/lua/provider/node/health.lua +++ b/runtime/lua/provider/node/health.lua @@ -1,5 +1,4 @@ local health = vim.health -local executable = health.executable local iswin = vim.loop.os_uname().sysname == 'Windows_NT' local M = {} @@ -12,8 +11,12 @@ function M.check() end if - not executable('node') - or (not executable('npm') and not executable('yarn') and not executable('pnpm')) + vim.fn.executable('node') == 0 + or ( + vim.fn.executable('npm') == 0 + and vim.fn.executable('yarn') == 0 + and vim.fn.executable('pnpm') == 0 + ) then health.warn( '`node` and `npm` (or `yarn`, `pnpm`) must be in $PATH.', @@ -50,9 +53,9 @@ function M.check() health.info('Nvim node.js host: ' .. host) local manager = 'npm' - if executable('yarn') then + if vim.fn.executable('yarn') == 1 then manager = 'yarn' - elseif executable('pnpm') then + elseif vim.fn.executable('pnpm') == 1 then manager = 'pnpm' end |