diff options
author | Oliver Schneider <oliver@assarbad.net> | 2016-01-12 23:01:22 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2016-01-12 23:01:22 +0300 |
commit | 32dbee7029ba110af841e67b0816b747bdf3c0c2 (patch) | |
tree | eb225f5fc540ba11a65fcf648f0e0d2578d7b528 /scripts | |
parent | c156c8b6a15d155fa4e2716046e1572c36927e8e (diff) |
Adding the names of the scripts so the traceback for chunks gives more usable output
--HG--
branch : WDS-build
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/embed.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/embed.lua b/scripts/embed.lua index 5dd08c5..b83e51e 100644 --- a/scripts/embed.lua +++ b/scripts/embed.lua @@ -68,6 +68,7 @@ function doembed() raw_sum = 0 trim_sum = 0 + fnames = "const char* builtin_script_fnames[] = {" -- load the manifest of script files scripts = dofile("src/_manifest.lua") @@ -84,10 +85,14 @@ for i,fn in ipairs(scripts) do print(fn) local s = stripfile("src/" .. fn) + fnames = fnames .. "\n" .. "\t\"" .. fn .. "\"," writefile(out, fn, s) end - out:write("\t0\n};\n"); + out:write("\t0\n};\n\n"); + out:write(fnames); + out:write("\n\t0\n};\n"); + out:close() print(string.format("Lua scripts trimmed down to %2.1f%% of original size (%d/%d)", (trim_sum / raw_sum) * 100, trim_sum, raw_sum)) end |