2018-01-19 03:57:48 +00:00
|
|
|
local site = os.getenv('GLUON_SITEDIR') .. '/'
|
|
|
|
local config = os.getenv('GLUON_SITE_CONFIG')
|
2015-12-30 02:35:17 +00:00
|
|
|
|
|
|
|
local function loader()
|
|
|
|
coroutine.yield('return ')
|
2018-01-19 03:57:48 +00:00
|
|
|
coroutine.yield(io.open(site..config):read('*a'))
|
2015-12-30 02:35:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
|
2018-01-19 03:57:48 +00:00
|
|
|
return setfenv(assert(load(coroutine.wrap(loader), config)), {})()
|