Merge branch 'main' into main

This commit is contained in:
hoofcushion 2025-01-06 19:16:00 +08:00 committed by GitHub
commit 03b894ee5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 1855 additions and 140 deletions

View file

@ -350,7 +350,9 @@ function M._load(plugin, reason, opts)
Util.track({ plugin = plugin.name, start = reason.start })
Handler.disable(plugin)
M.add_to_rtp(plugin)
if not plugin.virtual then
M.add_to_rtp(plugin)
end
if plugin._.pkg and plugin._.pkg.source == "rockspec" then
M.add_to_luapath(plugin)
@ -362,7 +364,9 @@ function M._load(plugin, reason, opts)
end, "Failed to load deps for " .. plugin.name)
end
M.packadd(plugin.dir)
if not plugin.virtual then
M.packadd(plugin.dir)
end
if plugin.config or plugin.opts then
M.config(plugin)
end
@ -502,8 +506,11 @@ function M.add_to_luapath(plugin)
local root = Config.options.rocks.root .. "/" .. plugin.name
local path = root .. "/share/lua/5.1"
local cpath = root .. "/lib/lua/5.1"
local cpath2 = root .. "/lib64/lua/5.1"
package.path = package.path .. ";" .. path .. "/?.lua;" .. path .. "/?/init.lua;"
package.cpath = package.cpath .. ";" .. cpath .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
package.cpath = package.cpath .. ";" .. cpath2 .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
end
function M.source(path)