47 lines
907 B
Lua
47 lines
907 B
Lua
|
local actions = {}
|
||
|
|
||
|
local function list(dir)
|
||
|
local h = io.popen("ls \""..dir.."\"", "r")
|
||
|
local ents = {}
|
||
|
for l in h:lines() do
|
||
|
ents[#ents+1] = l
|
||
|
end
|
||
|
h:close()
|
||
|
return ents
|
||
|
end
|
||
|
|
||
|
local function find(dir, pattern, inverse, ctype)
|
||
|
local h = io.popen("find \""..dir.."\" "..(((inverse) and "-not ") or "")..(((ctype) and "-type "..ctype.." ") or "").."-name \""..pattern.."\"", "r")
|
||
|
local ents = {}
|
||
|
for l in h:lines() do
|
||
|
ents[#ents+1] = l
|
||
|
end
|
||
|
h:close()
|
||
|
return ents
|
||
|
end
|
||
|
|
||
|
local function lastmod(file)
|
||
|
local h = io.popen("stat -c %Y \""..file.."\"")
|
||
|
local num = tonumber(h:read("*a"))
|
||
|
h:close()
|
||
|
return num
|
||
|
end
|
||
|
|
||
|
@[[local h = io.popen("ls .buildactions", "r")
|
||
|
for line in h:lines() do]]
|
||
|
--#include @[{".buildactions/"..line}]
|
||
|
@[[end]]
|
||
|
|
||
|
function actions.all()
|
||
|
for i=1, #actions do
|
||
|
actions[actions[i]]()
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if not arg[1] then
|
||
|
arg[1] = "all"
|
||
|
end
|
||
|
|
||
|
actions[arg[1]]()
|
||
|
|
||
|
print("Build complete.")
|