From 8414af5334bb89a671112bb904a6e230bd67c435 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 Jan 2016 17:42:43 +0800 Subject: fix find tool bug --- xmake/core/tools/tools.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/core/tools/tools.lua b/xmake/core/tools/tools.lua index 7ae54fdec..2cde4ffc9 100644 --- a/xmake/core/tools/tools.lua +++ b/xmake/core/tools/tools.lua @@ -36,10 +36,6 @@ function tools._match(name, toolname) -- match full? ok if name == toolname then return 100 end - -- match the name for windows? ok - if name:find("^" .. toolname .. "%.exe") then return 90 end - if name:find(toolname .. "%.exe") then return 85 end - -- match the last word? ok if name:find(toolname .. "$") then return 80 end @@ -120,6 +116,10 @@ function tools.find(name, root) -- init filename local filepath = nil + -- uses the basename only + name = path.basename(name) + assert(name) + -- only find it from this directory if the given directory exists if root then return tools._find_from(root, name) end -- cgit v1.3.1