diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/path.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 598e51d9..fb5eec7e 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua | |||
@@ -339,6 +339,8 @@ function path.map_trees(deps_mode, fn, ...) | |||
339 | return result | 339 | return result |
340 | end | 340 | end |
341 | 341 | ||
342 | local is_src_extension = { [".lua"] = true, [".tl"] = true, [".tld"] = true, [".moon"] = true } | ||
343 | |||
342 | --- Return the pathname of the file that would be loaded for a module, indexed. | 344 | --- Return the pathname of the file that would be loaded for a module, indexed. |
343 | -- @param module_name string: module name (eg. "socket.core") | 345 | -- @param module_name string: module name (eg. "socket.core") |
344 | -- @param name string: name of the package (eg. "luasocket") | 346 | -- @param name string: name of the package (eg. "luasocket") |
@@ -349,7 +351,8 @@ end | |||
349 | -- @return string: filename of the module (eg. "/usr/local/lib/lua/5.1/socket/core.so") | 351 | -- @return string: filename of the module (eg. "/usr/local/lib/lua/5.1/socket/core.so") |
350 | function path.which_i(module_name, name, version, tree, i) | 352 | function path.which_i(module_name, name, version, tree, i) |
351 | local deploy_dir | 353 | local deploy_dir |
352 | if module_name:match("%.lua$") then | 354 | local extension = module_name:match("%.[a-z]+$") |
355 | if is_src_extension[extension] then | ||
353 | deploy_dir = path.deploy_lua_dir(tree) | 356 | deploy_dir = path.deploy_lua_dir(tree) |
354 | module_name = dir.path(deploy_dir, module_name) | 357 | module_name = dir.path(deploy_dir, module_name) |
355 | else | 358 | else |