Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Apr 26, 2024
1 parent b948a15 commit 6c17812
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lua/dotvim/pkgs/base/plugins/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
return {
"williamboman/mason.nvim",
opts = {
PATH = "skip",
PATH = "append",
ui = {
icons = {
package_installed = "",
Expand Down
55 changes: 28 additions & 27 deletions lua/dotvim/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,34 @@ end
---@param name string
---@return string
function M.which(name)
if type(name) ~= "string" then
return name
end

return which_cache:ensure({ "bin", name }, function()
if M.nix.is_nix_managed() then
local ret = M.nix.resolve_bin(name)
if ret ~= nil then
return ret
end
end

-- nixos should not try to resolve binaries from mason
if M.nix.is_nixos() then
return name
end

if M.lazy.has("mason.nvim") then
local mason_root = require("mason.settings").current.install_root_dir
local path = mason_root .. "/bin/" .. name
if vim.fn.executable(path) == 1 then
return path
end
end

return name
end)
return name
-- if type(name) ~= "string" then
-- return name
-- end
--
-- return which_cache:ensure({ "bin", name }, function()
-- if M.nix.is_nix_managed() then
-- local ret = M.nix.resolve_bin(name)
-- if ret ~= nil then
-- return ret
-- end
-- end
--
-- -- nixos should not try to resolve binaries from mason
-- if M.nix.is_nixos() then
-- return name
-- end
--
-- if M.lazy.has("mason.nvim") then
-- local mason_root = require("mason.settings").current.install_root_dir
-- local path = mason_root .. "/bin/" .. name
-- if vim.fn.executable(path) == 1 then
-- return path
-- end
-- end
--
-- return name
-- end)
end

---NOTE: opts will be modified in place
Expand Down

0 comments on commit 6c17812

Please sign in to comment.