buildat/client/extensions.lua

18 lines
500 B
Lua
Raw Normal View History

2014-09-19 14:50:25 +03:00
local log = buildat.Logger("__client/extensions")
2014-09-19 11:29:23 +03:00
function __buildat_load_extension(name)
log:info("__buildat_load_extension(\""..name.."\")")
return dofile(__buildat_get_path("share").."/extensions/"..name.."/init.lua")
end
table.insert(package.loaders, function(name)
log:info("package.loader called with name=\""..name.."\"")
local m = string.match(name, '^buildat/extension/([a-zA-Z0-9_]+)$')
if m then
return function()
return __buildat_load_extension(m)
end
end
return nil
end)