From 95f46b973794b37ccd62edbcc3bfb010b0f23dcc Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 15 Dec 2018 00:41:39 +0800 Subject: improve interpreter --- xmake/core/base/task.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xmake/core/base/task.lua') diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua index b2b5b25a0..d42609756 100644 --- a/xmake/core/base/task.lua +++ b/xmake/core/base/task.lua @@ -317,9 +317,15 @@ function task._load(filepath) local interp = task._interpreter() assert(interp) + -- load script + local ok, errors = interp:load(filepath) + if not ok and os.isfile(filepath) then + return nil, errors + end + -- load tasks - local tasks, errors = interp:load(filepath, "task", true, true) - if not tasks and os.isfile(filepath) then + local tasks, errors = interp:make("task", true, true) + if not tasks then return nil, errors end -- cgit v1.3.1