Skip to content

Commit

Permalink
more verbose doctor out
Browse files Browse the repository at this point in the history
  • Loading branch information
davidosomething committed Oct 27, 2024
1 parent e223369 commit 3761c2d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nvim/lua/dko/tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,24 @@ M.get_efm_languages = function(filter)
end)
end

--- cache for filter_executable_groups
local fegcache = {}

---Get a list of tools that CAN be installed because required binary available
---@param groups ToolGroups
---@param category string for logging only
---@return ToolGroups --- { ["npm"] = { "prettier" = {...config} } if npm is executable
M.filter_executable_groups = function(category, groups)
if not fegcache[category] then
fegcache[category] = dkotable.filter(groups, function(_, bin)
fegcache[category] = dkotable.filter(groups, function(tool_configs, bin)
if bin ~= "_" and vim.fn.executable(bin) == 0 then
local tool_names = table.concat(vim.tbl_keys(tool_configs), ", ")
require("dko.doctor").warn({
category = category,
message = ("[%s] %s not found, skip installation"):format(
message = ("[%s] Executable `%s` not found, skipping: %s"):format(
category,
bin
bin,
tool_names
),
})
return false
Expand Down

0 comments on commit 3761c2d

Please sign in to comment.