site_config.lua 339 B

12345678910
  1. local site = os.getenv('GLUON_SITEDIR') .. '/'
  2. local config = os.getenv('GLUON_SITE_CONFIG')
  3. local function loader()
  4. coroutine.yield('return ')
  5. coroutine.yield(io.open(site..config):read('*a'))
  6. end
  7. -- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
  8. return setfenv(assert(load(coroutine.wrap(loader), config)), {})()