diff options
Diffstat (limited to 'src/luarocks/path.lua')
-rw-r--r-- | src/luarocks/path.lua | 10 |
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 | ||
38 | function root_dir(rocks_dir) | 38 | function 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 .. ".*$") |
43 | end | 42 | end |
44 | 43 | ||
44 | function 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 | ||
51 | end | ||
52 | |||
45 | function deploy_bin_dir(tree) | 53 | function 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") |