diff options
| author | ruki <[email protected]> | 2017-06-17 23:53:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-17 23:53:44 +0800 |
| commit | ab8048f449cf267cadcd79ba1862985cdebaf3b7 (patch) | |
| tree | 7e8a610b1eedd73edf8cd6c4c204b3289713114c | |
| parent | e701b9cbef180ca6b222327abab7b92cdf661fe1 (diff) | |
fix find tool bug for old script
| -rw-r--r-- | xmake/core/tool/tool.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 7b139b12b..6db2e4439 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -84,10 +84,13 @@ function tool._find(root, name) name = names[#names] end - -- get the last name by '-': xxx-xxx-toolname - local names = name:split("%-") - if #names > 0 then - name = names[#names] + -- get the last valid name: xxx-xxx-toolname-5 + local partnames = {} + for partname in name:gmatch("([%a%+]+)") do + table.insert(partnames, partname) + end + if #partnames > 0 then + name = partnames[#partnames] end -- remove suffix: ".xxx" |
