diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-06-10 16:38:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-06-10 16:38:16 +0200 |
commit | bd8f4d00a5ba1af56451821cd1db1c12c22f5419 (patch) | |
tree | 4dffba85530d56d31a05684c7c071b77d163371a /scripts | |
parent | 93dccfc40625a754b372edd228724969b28e4342 (diff) | |
download | context-bd8f4d00a5ba1af56451821cd1db1c12c22f5419.tar.gz |
2018-06-10 15:49:00
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-package.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/context/lua/mtx-package.lua b/scripts/context/lua/mtx-package.lua index 23da30bf2..c4487faec 100644 --- a/scripts/context/lua/mtx-package.lua +++ b/scripts/context/lua/mtx-package.lua @@ -69,8 +69,19 @@ function scripts.package.merge_luatex_files(name) end end end - report("saving %q",newname) - io.savedata(newname,table.concat(collected)) + collected = table.concat(collected) + if environment.argument("stripcontext") then + local n = 0 + collected = string.gsub(collected,"\nif context then.-\nend",function(s) + n = n + #s + return "" + end) + if n > 0 then + report("%i context specific bytes stripped",n) + end + end + report("saving %q (%i bytes)",newname,#collected) + io.savedata(newname,collected) end end end |