mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-20 21:36:45 +00:00
feat(rocks): use hererocks to install luarocks when luarocks is not found
This commit is contained in:
parent
dea1f687fe
commit
d87da76679
5 changed files with 58 additions and 2 deletions
|
@ -33,7 +33,9 @@ function M:load_pkgs()
|
|||
if not Config.options.pkg.enabled then
|
||||
return
|
||||
end
|
||||
local have_rockspec = false
|
||||
for _, pkg in ipairs(Pkg.get()) do
|
||||
have_rockspec = have_rockspec or pkg.source == "rockspec"
|
||||
local meta, fragment = self:add(pkg.spec)
|
||||
if meta and fragment then
|
||||
meta._.pkg = pkg
|
||||
|
@ -46,6 +48,12 @@ function M:load_pkgs()
|
|||
self.pkgs[pkg.dir] = fragment.id
|
||||
end
|
||||
end
|
||||
if have_rockspec then
|
||||
local hererocks = Pkg.hererocks()
|
||||
if hererocks then
|
||||
self:add(hererocks)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Remove a plugin and all its fragments.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue