20 lines
583 B
Lua
20 lines
583 B
Lua
|
require "libs"
|
||
|
local config = require "config"
|
||
|
local FolderLoader = require "classes.folderloader"
|
||
|
|
||
|
local json = require "libs.json"
|
||
|
|
||
|
for _, value in ipairs(config) do
|
||
|
print("Début de génération du fichier " .. value.folder .. ".json")
|
||
|
clock = os.clock()
|
||
|
|
||
|
local datas = FolderLoader.getAllDatas(value)
|
||
|
|
||
|
local file = io.open("build/" .. value.folder .. ".json", "w")
|
||
|
if (file ~= nil) then
|
||
|
file:write(json.encode(datas))
|
||
|
end
|
||
|
|
||
|
clock = os.clock() - clock
|
||
|
print("Génération du fichier " .. value.folder .. ".json en " .. clock .. " seconds")
|
||
|
end
|