summaryrefslogtreecommitdiff
path: root/xmake/core/base/task.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/task.lua')
-rw-r--r--xmake/core/base/task.lua10
1 files changed, 8 insertions, 2 deletions
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