Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created May 24, 2011 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoelzro/989722 to your computer and use it in GitHub Desktop.
Save hoelzro/989722 to your computer and use it in GitHub Desktop.
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