refactor(rocks): is_simple_build

This commit is contained in:
Folke Lemaitre 2024-06-26 11:11:00 +02:00
parent 2aa8e061f2
commit 90e14d1585
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 7 additions and 6 deletions

View File

@ -183,6 +183,12 @@ function M.build(task)
})
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
---@return table?
function M.parse(file)
@ -271,12 +277,7 @@ function M.get(plugin)
-- and don't have a rockspec mapping
or #rocks > 0
-- has a complex build process
or (
rockspec.build
and rockspec.build.type
and rockspec.build.type ~= "none"
and not (rockspec.build.type == "builtin" and not rockspec.build.modules)
)
or not M.is_simple_build(rockspec)
if not use then
-- community specs only