1
0
mirror of https://github.com/Adorable-Catgirl/LuaComp.git synced 2024-09-29 07:00:58 +10:00
LuaComp/src/directives/loadmod.lua

13 lines
416 B
Lua
Raw Normal View History

2019-11-06 06:47:42 +11:00
local warned = false
function directives.loadmod(env, mod)
if not warned then
2019-12-15 09:16:32 +11:00
io.stderr:write("Warning: loadmod is depreciated and unsafe. The API differs from luapreproc. Use the include paths!\n")
2019-11-06 06:47:42 +11:00
warned = true
end
if (not os.execute("stat "..file..">/dev/null")) then
return false, "Module `"..file.."' does not exist!"
end
local modname, func = dofile(mod)
directives[modname] = func
return true
end