feat deps-check: load only when used
This commit is contained in:
@@ -25,7 +25,12 @@ function M.checkCommand(cmd, desc)
|
||||
end
|
||||
|
||||
function M.run()
|
||||
print("Check installed system commands:")
|
||||
if cmdsList == nil or next(cmdsList) == nil then
|
||||
vim.api.nvim_echo({{"Dependencies list passed is null or empty, nothing to check", "DiagnosticWarn"}}, true, {})
|
||||
return
|
||||
end
|
||||
|
||||
print("Check installed system commands:")
|
||||
for i, cmd in ipairs(cmdsList) do
|
||||
M.checkCommand(cmd.cmd, cmd.desc)
|
||||
end
|
||||
@@ -34,7 +39,6 @@ end
|
||||
function M.setup(cmds)
|
||||
IS_UNIX = package.config:sub(1, 1) ~= "\\"
|
||||
cmdsList = cmds
|
||||
vim.api.nvim_create_user_command("DependenciesCheck", M.run, {})
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user