diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-08-10 13:15:31 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-08-10 13:15:31 +0200 |
commit | d3d93bc4f0d21a259fdafee5ba1a744999474c28 (patch) | |
tree | 433bd6ca86fd62a858e086bee7c5abf412c16845 /tex/context/base/mkiv/grph-fil.lua | |
parent | 06f5d61e0db05d0803ac5b6b4953937c3b88f1ea (diff) | |
download | context-d3d93bc4f0d21a259fdafee5ba1a744999474c28.tar.gz |
2021-08-10 12:39:00
Diffstat (limited to 'tex/context/base/mkiv/grph-fil.lua')
-rw-r--r-- | tex/context/base/mkiv/grph-fil.lua | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/grph-fil.lua b/tex/context/base/mkiv/grph-fil.lua index 1044d29d9..2cf2a54cc 100644 --- a/tex/context/base/mkiv/grph-fil.lua +++ b/tex/context/base/mkiv/grph-fil.lua @@ -90,7 +90,21 @@ local function analyzed(name) } end -function jobfiles.run(action) +function jobfiles.run(name,action) + local kind = type(name) + if kind == "string" then + local usedname = addsuffix(name,inputsuffix) + action = { + filename = usedname, + action = action, + resultfile = replacesuffix(usedname,resultsuffix), + } + elseif kind == "table" then + action = name + else + report_run("invalid specification for jobfiles.run") + return + end local filename = action.filename local result = action.result local oldchecksum = collected[filename] @@ -121,7 +135,17 @@ function jobfiles.run(action) end end if tobedone then - runner(action) + kind = type(action) + if kind == "function" then + action(filename) + elseif kind == "string" and action ~= "" then + -- can be anything but we assume it gets checked by the sandbox + os.execute(action) + elseif kind == "table" then + runner(action) + else + report_run("processing file, no action given for processing %a",name) + end elseif trace_run then report_run("processing file, no changes in %a, not processed",name) end |