add mason autodownloader

This commit is contained in:
sadan 2024-05-28 00:15:08 -04:00
parent c8c07c75fd
commit 4af9d8ed01
No known key found for this signature in database
2 changed files with 19 additions and 0 deletions

17
lua/masonDownload.lua Normal file
View file

@ -0,0 +1,17 @@
local pkgs = {
"nixpkgs-fmt",
"jdtls",
"yaml-language-server",
"eslint_d",
}
local reg = require("mason-registry")
for _, pname in ipairs(pkgs) do
local pkg = reg.get_package(pname)
if not pkg:is_installed() then
print(string.format("[masonDownload.lua]: %s is not installed. Installing.", pname))
local handle = pkg:install(nil)
--while handle.state ~= "CLOSED" do
-- print(handle.stdout)
-- end
end
end