summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-context.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2014-01-21 17:00:18 +0200
committerMarius <mariausol@gmail.com>2014-01-21 17:00:18 +0200
commitc9b715ef8332f82ec94a3eff2c60dd6273639f75 (patch)
treefecdbc77d96928f02838a10bd0e5221d7a95a9a6 /scripts/context/lua/mtx-context.lua
parente1391d4e5204dd3f121abf16e1eb8125696b57e2 (diff)
downloadcontext-c9b715ef8332f82ec94a3eff2c60dd6273639f75.tar.gz
beta 2014.01.21 15:48
Diffstat (limited to 'scripts/context/lua/mtx-context.lua')
-rw-r--r--scripts/context/lua/mtx-context.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 4c6672051..9b620603e 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -87,14 +87,17 @@ scripts.context = scripts.context or { }
-- for the moment here
-if getargument("jit") or getargument("jiton") then
+if jit then -- already luajittex
+ setargument("engine","luajittex")
+ setargument("jit",nil)
+elseif getargument("jit") or getargument("jiton") then -- relaunch luajittex
-- bonus shortcut, we assume than --jit also indicates the engine
-- although --jit and --engine=luajittex are independent
setargument("engine","luajittex")
end
-local engine_new = getargument("engine") or directives.value("system.engine")
-local engine_old = environment.ownbin
+local engine_new = file.nameonly(getargument("engine") or directives.value("system.engine"))
+local engine_old = file.nameonly(environment.ownbin)
local function restart(engine_old,engine_new)
local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline())