Created
May 24, 2011 21:22
-
-
Save hoelzro/989722 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local names = {'wikipedia'} | |
plugins = {} | |
for _, plugin_name in ipairs(names) do | |
local plugin_env = setmetatable({}, { __index = getfenv(0), __metatable = {} }) | |
local plugin_chunk = loadfile(plugin_name .. '.lua') | |
setfenv(plugin_chunk, plugin_env) | |
pcall(plugin_chunk) | |
plugins[plugin_env.command] = plugin_env | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment