mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 21:06:46 +00:00
feat: show rockspec deps in plugin details
This commit is contained in:
parent
0f45c0d062
commit
656d3d1f5b
2 changed files with 22 additions and 2 deletions
|
@ -1,12 +1,27 @@
|
|||
--# selene:allow(incorrect_standard_library_use)
|
||||
|
||||
local Util = require("lazy.core.util")
|
||||
local Config = require("lazy.core.config")
|
||||
local Util = require("lazy.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
M.dev_suffix = "-1.rockspec"
|
||||
M.skip = { "lua" }
|
||||
|
||||
---@param plugin LazyPlugin
|
||||
function M.deps(plugin)
|
||||
local root = Config.options.rocks.root .. "/" .. plugin.name
|
||||
local manifest_file = root .. "/lib/luarocks/rocks-5.1/manifest"
|
||||
local manifest = {}
|
||||
local ok = pcall(function()
|
||||
local load, err = loadfile(manifest_file, "t", manifest)
|
||||
if not load then
|
||||
error(err)
|
||||
end
|
||||
load()
|
||||
end)
|
||||
return manifest and vim.tbl_keys(manifest.repository or {})
|
||||
end
|
||||
|
||||
---@class RockSpec
|
||||
---@field rockspec_format string
|
||||
---@field package string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue