aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason.lua
blob: 82da0570e294456f87a35d36e2eb548cf1724ea7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local settings = require "mason.settings"
local path = require "mason.core.path"
local platform = require "mason.core.platform"

local M = {}

---@param config MasonSettings | nil
function M.setup(config)
    if config then
        settings.set(config)
    end

    vim.env.PATH = path.bin_prefix() .. platform.path_sep .. vim.env.PATH

    require "mason.command-api"
end

---@param pkg_path string
local function lazy_require(pkg_path)
    return setmetatable({}, {
        __index = function(_, k)
            return require(pkg_path)[k]
        end,
        __call = function(_, ...)
            return require(pkg_path)(...)
        end,
    })
end

return M