feat/pack #1
@ -234,21 +234,29 @@ function M.mason_install()
|
||||
|
||||
local result = utils.await(function(resolve)
|
||||
for _, name in ipairs(packages) do
|
||||
print('Mason package installing: ' .. name)
|
||||
local pkg = registry.get_package(name)
|
||||
pkg:install({}, function(success, error)
|
||||
if success then
|
||||
print('Mason package installed: ' .. name)
|
||||
else
|
||||
print('Mason package failed: ' .. name)
|
||||
print(' > Error: ' .. vim.inspect(error))
|
||||
end
|
||||
|
||||
if pkg:is_installed() then
|
||||
print('Mason package already installed: ' .. name)
|
||||
pending = pending - 1
|
||||
if pending == 0 then
|
||||
resolve(true)
|
||||
end
|
||||
end)
|
||||
else
|
||||
print('Mason package installing: ' .. name)
|
||||
pkg:install({}, function(success, error)
|
||||
if success then
|
||||
print('Mason package installed: ' .. name)
|
||||
else
|
||||
print('Mason package failed: ' .. name)
|
||||
print(' > Error: ' .. vim.inspect(error))
|
||||
end
|
||||
|
||||
pending = pending - 1
|
||||
if pending == 0 then
|
||||
resolve(true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end, 5 * 60 * 1000, 200)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user