lazy.nvim/lua/lazy/community/init.lua

29 lines
523 B
Lua
Raw Permalink Normal View History

2024-06-25 17:07:26 +01:00
local M = {}
---@type table<string, string>
local mapping = nil
local function load()
if not mapping then
mapping = {}
---@type {name:string, url:string, version:string}[]
local gen = require("lazy.community._generated")
for _, rock in ipairs(gen) do
mapping[rock.name] = rock.url
end
2024-06-25 17:07:26 +01:00
end
return mapping
2024-06-25 17:07:26 +01:00
end
---@param rock string
---@return string?
function M.get_url(rock)
return load()[rock]
2024-06-25 17:07:26 +01:00
end
function M.get_spec(name)
return require("lazy.community.specs")[name]
end
2024-06-25 17:07:26 +01:00
return M