1 -- Compile all files called *.mluam in a directory and its sub-directories,
2 -- into their *.luac counterpart.
4 -- This script is windows-only, Unices have half-decent shell script languages
5 -- which let you do the same with a find and an xargs.
8 for _, a in ipairs(arg) do
9 local var, val = a :match "^(.-)=(.*)"
10 if var then cfg[var] = val end
13 if not cfg.command or not cfg.directory then
14 error ("Usage: "..arg[0].." command=<metalua command> directory=<library root>")
17 local f = io.popen ("dir /S /b " .. cfg.directory)
18 for src in f:lines() do
19 local base = src:match "^(.+)%.mlua$"
21 local cmd = cfg.command.." "..src.." -o "..base..".luac"