From f6c98d5bc0f9243104e432bf5a867c40b467537b Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 28 May 2022 18:22:20 -0400 Subject: [PATCH] fix: allow function arg to add runner --- nature/runner.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nature/runner.lua b/nature/runner.lua index 4a08ce7..4935468 100644 --- a/nature/runner.lua +++ b/nature/runner.lua @@ -17,8 +17,12 @@ function runnerHandler.add(name, runner) error 'expected runner name to be a table' end + if type(runner) == 'function' then + runner = {run = runner} -- this probably looks confusing + end + if type(runner) ~= 'table' then - error 'expected runner to be a table' + error 'expected runner to be a table or function' end if runners[name] then