feat: spec.rocks is no longer needed & added support for installing any luarock

This commit is contained in:
Folke Lemaitre 2024-06-24 14:14:41 +02:00
parent 66249054c4
commit 73ea05feda
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
10 changed files with 120 additions and 235 deletions

View file

@ -226,9 +226,6 @@ M.mapleader = nil
---@type string
M.maplocalleader = nil
---@type {specs:string, tree:string, path:string, cpath:string}
M.rocks = {}
function M.headless()
return #vim.api.nvim_list_uis() == 0
end
@ -279,17 +276,6 @@ function M.setup(opts)
M.mapleader = vim.g.mapleader
M.maplocalleader = vim.g.maplocalleader
M.rocks = {
specs = M.options.rocks.root .. "/specs",
tree = M.options.rocks.root .. "/tree",
path = M.options.rocks.root .. "/tree/share/lua/5.1",
cpath = M.options.rocks.root .. "/tree/lib/lua/5.1",
}
vim.fn.mkdir(M.rocks.specs, "p")
vim.fn.mkdir(M.rocks.tree, "p")
package.path = package.path .. ";" .. M.rocks.path .. "/?.lua;" .. M.rocks.path .. "/?/init.lua;"
package.cpath = package.cpath .. ";" .. M.rocks.cpath .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
if M.headless() then
require("lazy.view.commands").setup()
end