From d353b2984472824d0347e0e8a7ffb1112d6ebab2 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Feb 2016 20:24:13 +0800 Subject: check on_task_run --- xmake/core/base/task.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua index abdd40569..9c7d01abd 100644 --- a/xmake/core/base/task.lua +++ b/xmake/core/base/task.lua @@ -184,7 +184,17 @@ function task.run(name) -- get the task info local taskinfo = tasks[name] if not taskinfo then - utils.error("unknown task: %s", name) + + -- trace + utils.error("task(\"%s\"): unknown task", name) + return false + end + + -- check + if not taskinfo.run then + + -- trace + utils.error("task(\"%s\"): no run script, please call on_task_run() first!", name) return false end -- cgit v1.3.1