You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function Require(name,report_lib_error)
if not name then
trace()
return nil
end
local path = os.getenv("GASP_PATH") .. "/lib/" .. name .. ".so"
local func, err = loadlib(path,'luaopen_' .. name)
if not func then
if report_lib_error then
dump_lua_stack()
error(err .. debug.traceback())
return nil
end
path = os.getenv("GASP_PATH") .. "/lua/" .. name
func, err = loadfile(path)
if not func then
dump_lua_stack()
error(err .. debug.traceback())
return nil
end
end
return func, pcall( func )
end
The text was updated successfully, but these errors were encountered:
Never mind it was an issue with my code, for anyone who saw this and was curious about how I fixed it here's the code:
function _RequireLib(dir,name,report_attempts,error_on_failure)
local paths, p, v, ret, err = { name, name .. ".so" }
for p, v in pairs(paths) do
if not ret then
local path = dir .. "/" .. v
ret, err = loadlib(path,'luaopen_' .. name)
if report_attempts then
print("Trying " .. path)
end
end
end
if error_on_failure and not ret then
dump_lua_stack()
error( err .. _trace() )
end
return ret, err
end
function _RequireLua( name, report_attempts )
local dir = os.getenv("GASP_PATH")
local paths, p, v, ret, err =
{
name
, name .. ".lua"
, "lua/" .. name
, "lua/" .. name .. ".lua"
}
for p, v in pairs(paths) do
if not ret then
local path = dir .. "/" .. v
ret, err = loadfile(path)
if report_attempts then
print("Trying " .. path)
end
end
end
if not ret then
dump_lua_stack()
error( (err or "nil\n") .. _trace() )
end
return pcall( ret ), err, ret
end
function Require(name,report_attempts,onlylibs)
if not name then
trace()
return nil
end
local ret, err = _RequireLib
(
os.getenv("GASP_PATH") .. "/lib", name, report_attempts, onlylibs
)
if not ret then
return _RequireLua( name, report_attempts )
end
return ret, err
end
I'll leave the issue open since the title can fit more than just my own post, peops can just post their own here if they don't which is
the source like I didn't
The error (with paths stripped)
My lua code
The text was updated successfully, but these errors were encountered: