diff --git a/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua b/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua new file mode 100644 index 00000000..0735cd01 --- /dev/null +++ b/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua @@ -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')), {})()