aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/lua.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 2619d136..96017daa 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -123,7 +123,20 @@ function fs_lua.is_tool_available(tool_cmd, tool_name)
123 ok = tool_available_cache[tool_name] 123 ok = tool_available_cache[tool_name]
124 else 124 else
125 local tool_cmd_no_args = tool_cmd:gsub(" .*", "") 125 local tool_cmd_no_args = tool_cmd:gsub(" .*", "")
126 ok = fs.search_in_path(tool_cmd_no_args) 126
127 -- if it looks like the tool has a pathname, try that first
128 if tool_cmd_no_args:match("[/\\]") then
129 local fd = io.open(tool_cmd_no_args, "r")
130 if fd then
131 fd:close()
132 ok = true
133 end
134 end
135
136 if not ok then
137 ok = fs.search_in_path(tool_cmd_no_args)
138 end
139
127 tool_available_cache[tool_name] = (ok == true) 140 tool_available_cache[tool_name] = (ok == true)
128 end 141 end
129 142