summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-27 22:30:48 +0800
committerruki <[email protected]>2022-07-27 22:30:48 +0800
commit21823652b9c8a7fece9a00c0b8659c8a19b1c00f (patch)
tree9988a22d965db595d67a41a51fd46e65e77e572e /xmake/core/package/package.lua
parent77c7f62040c0b577ac0a7350fda95a9e48bcab32 (diff)
improve has_tool
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 94dd88b61..11db68e0d 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -993,9 +993,11 @@ end
-- end
function _instance:has_tool(toolkind, ...)
local _, toolname = self:tool(toolkind)
- for _, v in ipairs(table.join(...)) do
- if v and toolname:find("^" .. v:gsub("%-", "%%-") .. "$") then
- return true
+ if toolname then
+ for _, v in ipairs(table.join(...)) do
+ if v and toolname:find("^" .. v:gsub("%-", "%%-") .. "$") then
+ return true
+ end
end
end
end