feat deps-check: load only when used

This commit is contained in:
Ian
2026-07-11 08:17:52 +02:00
parent 2b60372114
commit 48223a6f54
2 changed files with 26 additions and 14 deletions
+6 -2
View File
@@ -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