gluon-core: add site_config loader script

This commit is contained in:
Matthias Schiffer 2014-05-13 20:14:57 +02:00
parent af14dc0c8c
commit 3c5c7d4fdf
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
local config = os.getenv('GLUON_SITE_CONFIG') or '/lib/gluon/site.conf'
local function loader()
coroutine.yield('return ')
coroutine.yield(io.open(config):read('*a'))
end
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
return setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()