diff --git a/lua/masonDownload.lua b/lua/masonDownload.lua new file mode 100644 index 0000000..69d61f9 --- /dev/null +++ b/lua/masonDownload.lua @@ -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 diff --git a/lua/setup.lua b/lua/setup.lua index 1daad3d..a8d9dce 100644 --- a/lua/setup.lua +++ b/lua/setup.lua @@ -4,6 +4,8 @@ vim.cmd([[colorscheme tokyonight]]) require("mason").setup() require("mason-lspconfig").setup() +require("masonDownload") + require("setuplsp") require("setupformat")