mirror of
https://github.com/NvChad/NvChad.git
synced 2024-11-10 07:10:44 +00:00
fix(MasonInstallAll): mason registry refresh callback (#2867)
Added refresh callback to make sure install package on first command. Right now it's not installing on first command.
This commit is contained in:
parent
d040295269
commit
7bfc159f63
@ -58,13 +58,16 @@ return {
|
|||||||
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
||||||
if opts.ensure_installed and #opts.ensure_installed > 0 then
|
if opts.ensure_installed and #opts.ensure_installed > 0 then
|
||||||
vim.cmd "Mason"
|
vim.cmd "Mason"
|
||||||
|
local mr = require("mason-registry")
|
||||||
|
|
||||||
|
mr.refresh(function()
|
||||||
for _, tool in ipairs(opts.ensure_installed) do
|
for _, tool in ipairs(opts.ensure_installed) do
|
||||||
local p = require("mason-registry").get_package(tool)
|
local p = mr.get_package(tool)
|
||||||
if not p:is_installed() then
|
if not p:is_installed() then
|
||||||
p:install()
|
p:install()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user