aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-05-29 18:25:14 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-05-31 11:16:09 -0300
commita18e84a704b61c361627c8c25c57beadf0cd85fd (patch)
tree414518dab4fde255746933f42c635cb4e980b6d8
parent262c43257a14bed458551e3337969689f4ea730d (diff)
downloadluarocks-a18e84a704b61c361627c8c25c57beadf0cd85fd.tar.gz
luarocks-a18e84a704b61c361627c8c25c57beadf0cd85fd.tar.bz2
luarocks-a18e84a704b61c361627c8c25c57beadf0cd85fd.zip
Let a explicitly given --tree override the wrapper's --project-tree
-rw-r--r--src/luarocks/command_line.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua
index a8977c24..a9cf9968 100644
--- a/src/luarocks/command_line.lua
+++ b/src/luarocks/command_line.lua
@@ -142,11 +142,7 @@ function command_line.run_command(...)
142 cfg.branch = flags["branch"] 142 cfg.branch = flags["branch"]
143 end 143 end
144 144
145 if flags["project-tree"] then 145 if flags["tree"] then
146 local tree = flags["project-tree"]
147 table.insert(cfg.rocks_trees, 1, { name = "project", root = tree } )
148 path.use_tree(tree)
149 elseif flags["tree"] then
150 local named = false 146 local named = false
151 for _, tree in ipairs(cfg.rocks_trees) do 147 for _, tree in ipairs(cfg.rocks_trees) do
152 if type(tree) == "table" and flags["tree"] == tree.name then 148 if type(tree) == "table" and flags["tree"] == tree.name then
@@ -162,6 +158,10 @@ function command_line.run_command(...)
162 local root_dir = fs.absolute_name(flags["tree"]) 158 local root_dir = fs.absolute_name(flags["tree"])
163 replace_tree(flags, root_dir) 159 replace_tree(flags, root_dir)
164 end 160 end
161 elseif flags["project-tree"] then
162 local tree = flags["project-tree"]
163 table.insert(cfg.rocks_trees, 1, { name = "project", root = tree } )
164 path.use_tree(tree)
165 elseif flags["local"] then 165 elseif flags["local"] then
166 if not cfg.home_tree then 166 if not cfg.home_tree then
167 die("The --local flag is meant for operating in a user's home directory.\n".. 167 die("The --local flag is meant for operating in a user's home directory.\n"..