We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 738c29f commit 0bc550bCopy full SHA for 0bc550b
lib/lunatik/runner.lua
@@ -11,7 +11,12 @@ local env = lunatik._ENV
11
12
local runner = {}
13
14
+local function trim(script) -- drop ".lua" file extension
15
+ return script:gsub("(%w+).lua", "%1")
16
+end
17
+
18
function runner.run(script, ...)
19
+ local script = trim(script)
20
if env.runtimes[script] then
21
error(string.format("%s is already running", script))
22
end
@@ -36,6 +41,7 @@ local function stop(registry, script)
36
41
37
42
38
43
function runner.stop(script)
44
39
45
stop(env.threads, script)
40
46
stop(env.runtimes, script)
47
0 commit comments