mirror of https://github.com/folke/lazy.nvim.git
refactor(rocks): is_simple_build
This commit is contained in:
parent
2aa8e061f2
commit
90e14d1585
|
@ -183,6 +183,12 @@ function M.build(task)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param rockspec RockSpec
|
||||||
|
function M.is_simple_build(rockspec)
|
||||||
|
local type = vim.tbl_get(rockspec, "build", "type")
|
||||||
|
return type == nil or type == "none" or (type == "builtin" and not rockspec.build.modules)
|
||||||
|
end
|
||||||
|
|
||||||
---@param file string
|
---@param file string
|
||||||
---@return table?
|
---@return table?
|
||||||
function M.parse(file)
|
function M.parse(file)
|
||||||
|
@ -271,12 +277,7 @@ function M.get(plugin)
|
||||||
-- and don't have a rockspec mapping
|
-- and don't have a rockspec mapping
|
||||||
or #rocks > 0
|
or #rocks > 0
|
||||||
-- has a complex build process
|
-- has a complex build process
|
||||||
or (
|
or not M.is_simple_build(rockspec)
|
||||||
rockspec.build
|
|
||||||
and rockspec.build.type
|
|
||||||
and rockspec.build.type ~= "none"
|
|
||||||
and not (rockspec.build.type == "builtin" and not rockspec.build.modules)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not use then
|
if not use then
|
||||||
-- community specs only
|
-- community specs only
|
||||||
|
|
Loading…
Reference in New Issue