aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/command_line.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/command_line.lua')
-rw-r--r--src/luarocks/command_line.lua14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua
index ff8699ff..02793c5a 100644
--- a/src/luarocks/command_line.lua
+++ b/src/luarocks/command_line.lua
@@ -33,14 +33,6 @@ local function is_writable(tree)
33 end 33 end
34end 34end
35 35
36local function use_tree(tree)
37 cfg.root_dir = tree
38 cfg.rocks_dir = path.rocks_dir(tree)
39 cfg.deploy_bin_dir = path.deploy_bin_dir(tree)
40 cfg.deploy_lua_dir = path.deploy_lua_dir(tree)
41 cfg.deploy_lib_dir = path.deploy_lib_dir(tree)
42end
43
44--- Main command-line processor. 36--- Main command-line processor.
45-- Parses input arguments and calls the appropriate driver function 37-- Parses input arguments and calls the appropriate driver function
46-- to execute the action requested on the command-line, forwarding 38-- to execute the action requested on the command-line, forwarding
@@ -97,12 +89,12 @@ function run_command(...)
97 die("Argument error: use --to=<path>") 89 die("Argument error: use --to=<path>")
98 end 90 end
99 local root_dir = fs.absolute_name(flags["to"]) 91 local root_dir = fs.absolute_name(flags["to"])
100 use_tree(root_dir) 92 path.use_tree(root_dir)
101 elseif flags["local"] then 93 elseif flags["local"] then
102 use_tree(cfg.home_tree) 94 path.use_tree(cfg.home_tree)
103 else 95 else
104 local trees = cfg.rocks_trees 96 local trees = cfg.rocks_trees
105 use_tree(trees[#trees]) 97 path.use_tree(trees[#trees])
106 end 98 end
107 99
108 if type(cfg.root_dir) == "string" then 100 if type(cfg.root_dir) == "string" then