aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/path.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/path.lua')
-rw-r--r--src/luarocks/path.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index 64a203ef..2ce0e078 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -37,11 +37,19 @@ end
37 37
38function root_dir(rocks_dir) 38function root_dir(rocks_dir)
39 assert(type(rocks_dir) == "string") 39 assert(type(rocks_dir) == "string")
40
41 local suffix = dir.path("lib", "luarocks") 40 local suffix = dir.path("lib", "luarocks")
42 return rocks_dir:match("(.*)" .. suffix .. ".*$") 41 return rocks_dir:match("(.*)" .. suffix .. ".*$")
43end 42end
44 43
44function rocks_tree_to_string(tree)
45 if type(tree) == "string" then
46 return tree
47 else
48 assert(type(tree) == "table")
49 return tree.root
50 end
51end
52
45function deploy_bin_dir(tree) 53function deploy_bin_dir(tree)
46 if type(tree) == "string" then 54 if type(tree) == "string" then
47 return dir.path(tree, "bin") 55 return dir.path(tree, "bin")