diff options
| author | ruki <[email protected]> | 2016-01-15 17:42:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-01-15 17:42:43 +0800 |
| commit | 8414af5334bb89a671112bb904a6e230bd67c435 (patch) | |
| tree | c961af7ae6235e086c77ee051bee5df33cd8276b | |
| parent | 3e74be5e0c38ec84efbc407edb7be1a92a9adfee (diff) | |
fix find tool bug
| -rw-r--r-- | xmake/core/tools/tools.lua | 8 |
1 files 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 |
