Initial commit

This commit is contained in:
kepler155c@gmail.com
2016-12-11 14:24:52 -05:00
commit fc243a9c12
110 changed files with 25577 additions and 0 deletions

24
sys/apis/config.lua Normal file
View File

@@ -0,0 +1,24 @@
local Util = require('util')
local Config = { }
Config.load = function(fname, data)
local filename = '/config/' .. fname
if not fs.exists('/config') then
fs.makeDir('/config')
end
if not fs.exists(filename) then
Util.writeTable(filename, data)
else
Util.merge(data, Util.readTable(filename) or { })
end
end
Config.update = function(fname, data)
local filename = '/config/' .. fname
Util.writeTable(filename, data)
end
return Config