Skip to content
Snippets Groups Projects
Unverified Commit e665bfe6 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: don't depend on luci.ltn12

parent c83b5b3c
No related branches found
No related tags found
No related merge requests found
local function get_site_config()
local config = '/lib/gluon/site.json'
local config = '/lib/gluon/site.json'
local json = require 'luci.jsonc'
local ltn12 = require 'luci.ltn12'
local json = require 'luci.jsonc'
local decoder = json.new()
local sink = decoder:sink()
local file = assert(io.open(config))
local file = assert(io.open(config))
local decoder = json.new()
ltn12.pump.all(ltn12.source.file(file), decoder:sink())
while true do
local chunk = file:read(2048)
if not chunk or chunk:len() == 0 then break end
sink(chunk)
end
file:close()
file:close()
return assert(decoder:get())
return assert(decoder:get())
end
local setmetatable = setmetatable
module 'gluon.site_config'
setmetatable(_M,
{
__index = get_site_config(),
}
)
setmetatable(_M, {
__index = get_site_config(),
})
return _M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment