Test
This commit is contained in:
@@ -201,4 +201,5 @@ function basalt.getAPI(name)
|
|||||||
return elementManager.getAPI(name)
|
return elementManager.getAPI(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return basalt
|
return basalt
|
||||||
@@ -24,16 +24,14 @@ end
|
|||||||
|
|
||||||
local function scanDir(dir)
|
local function scanDir(dir)
|
||||||
local files = {}
|
local files = {}
|
||||||
for _, file in ipairs(fs.list(dir)) do
|
for file in io.popen('find "'..dir..'" -type f -name "*.lua"'):lines() do
|
||||||
local path = fs.combine(dir, file)
|
local f = io.open(file, "r")
|
||||||
if fs.isDir(path) then
|
if f then
|
||||||
for subFile, content in pairs(scanDir(path)) do
|
local content = f:read("*all")
|
||||||
files[fs.combine(file, subFile)] = content
|
f:close()
|
||||||
end
|
-- Entferne den src/ Prefix vom Pfad für die Config
|
||||||
else
|
local configPath = file:gsub("^src/", "")
|
||||||
local f = fs.open(path, "r")
|
files[configPath] = content
|
||||||
files[file] = f.readAll()
|
|
||||||
f.close()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return files
|
return files
|
||||||
@@ -44,6 +42,8 @@ local config = {
|
|||||||
files = sourceFiles,
|
files = sourceFiles,
|
||||||
}
|
}
|
||||||
|
|
||||||
local f = fs.open("config.lua", "w")
|
local f = io.open("config.lua", "w")
|
||||||
f.write("return " .. serialize(config))
|
if f then
|
||||||
f.close()
|
f:write("return " .. serialize(config))
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user