fix(health): when executing commands show "command not found" on Windows platform.

This commit is contained in:
Leeto1970 2024-07-16 01:07:23 +08:00
commit a0a392935a

View file

@ -36,7 +36,7 @@ function M.have(cmd, opts)
local found
for _, c in ipairs(cmd) do
if vim.fn.executable(c) == 1 then
local version = vim.fn.system(c .. " " .. opts.version) or ""
local version = vim.fn.system([["]] .. c .. " " .. opts.version .. [["]]) or ""
if vim.v.shell_error ~= 0 then
opts.error(("failed to get version of {%s}\n%s"):format(c, version))
else