diff options
Diffstat (limited to 'runtime/lua/provider')
-rw-r--r-- | runtime/lua/provider/clipboard/health.lua | 5 | ||||
-rw-r--r-- | runtime/lua/provider/node/health.lua | 13 | ||||
-rw-r--r-- | runtime/lua/provider/python/health.lua | 11 | ||||
-rw-r--r-- | runtime/lua/provider/ruby/health.lua | 3 |
4 files changed, 16 insertions, 16 deletions
diff --git a/runtime/lua/provider/clipboard/health.lua b/runtime/lua/provider/clipboard/health.lua index dc33cb0ab0..e44f7d32cc 100644 --- a/runtime/lua/provider/clipboard/health.lua +++ b/runtime/lua/provider/clipboard/health.lua @@ -1,5 +1,4 @@ local health = vim.health -local executable = health.executable local M = {} @@ -8,8 +7,8 @@ function M.check() if os.getenv('TMUX') - and executable('tmux') - and executable('pbpaste') + and vim.fn.executable('tmux') == 1 + and vim.fn.executable('pbpaste') == 1 and not health.cmd_ok('pbpaste') then local tmux_version = string.match(vim.fn.system('tmux -V'), '%d+%.%d+') 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 diff --git a/runtime/lua/provider/python/health.lua b/runtime/lua/provider/python/health.lua index 333890b62b..a5bd738063 100644 --- a/runtime/lua/provider/python/health.lua +++ b/runtime/lua/provider/python/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 = {} @@ -60,7 +59,7 @@ local function check_bin(bin) if not is(bin, 'file') and (not iswin or not is(bin .. '.exe', 'file')) then health.error('"' .. bin .. '" was not found.') return false - elseif not executable(bin) then + elseif vim.fn.executable(bin) == 0 then health.error('"' .. bin .. '" is not executable.') return false end @@ -69,7 +68,7 @@ end -- Fetch the contents of a URL. local function download(url) - local has_curl = executable('curl') + local has_curl = vim.fn.executable('curl') == 1 if has_curl and vim.fn.system({ 'curl', '-V' }):find('Protocols:.*https') then local out, rc = health.system({ 'curl', '-sL', url }, { stderr = true, ignore_error = true }) if rc ~= 0 then @@ -77,7 +76,7 @@ local function download(url) else return out end - elseif executable('python') then + elseif vim.fn.executable('python') == 1 then local script = "try:\n\ from urllib.request import urlopen\n\ except ImportError:\n\ @@ -284,7 +283,7 @@ function M.check() if path_bin ~= vim.fs.normalize(python_exe) and vim.tbl_contains(python_multiple, path_bin) - and executable(path_bin) + and vim.fn.executable(path_bin) == 1 then python_multiple[#python_multiple + 1] = path_bin end @@ -472,7 +471,7 @@ function M.check() bin_dir, table.concat( vim.tbl_map(function(v) - return vim.fn.fnamemodify(v, ':t') + return vim.fs.basename(v) end, venv_bins), ', ' ) diff --git a/runtime/lua/provider/ruby/health.lua b/runtime/lua/provider/ruby/health.lua index 04f6e303e6..4d859597a4 100644 --- a/runtime/lua/provider/ruby/health.lua +++ b/runtime/lua/provider/ruby/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 = {} @@ -11,7 +10,7 @@ function M.check() return end - if not executable('ruby') or not executable('gem') then + if vim.fn.executable('ruby') == 0 or vim.fn.executable('gem') == 0 then health.warn( '`ruby` and `gem` must be in $PATH.', 'Install Ruby and verify that `ruby` and `gem` commands work.' |