fix: allow function arg to add runner

runners
TorchedSammy 2022-05-28 18:22:20 -04:00
parent dce49574e6
commit f6c98d5bc0
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 5 additions and 1 deletions

View File

@ -17,8 +17,12 @@ function runnerHandler.add(name, runner)
error 'expected runner name to be a table' error 'expected runner name to be a table'
end end
if type(runner) == 'function' then
runner = {run = runner} -- this probably looks confusing
end
if type(runner) ~= 'table' then if type(runner) ~= 'table' then
error 'expected runner to be a table' error 'expected runner to be a table or function'
end end
if runners[name] then if runners[name] then