From a18e84a704b61c361627c8c25c57beadf0cd85fd Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 29 May 2018 18:25:14 -0300 Subject: Let a explicitly given --tree override the wrapper's --project-tree --- src/luarocks/command_line.lua | 10 +++++----- 1 file 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(...) cfg.branch = flags["branch"] end - if flags["project-tree"] then - local tree = flags["project-tree"] - table.insert(cfg.rocks_trees, 1, { name = "project", root = tree } ) - path.use_tree(tree) - elseif flags["tree"] then + if flags["tree"] then local named = false for _, tree in ipairs(cfg.rocks_trees) do if type(tree) == "table" and flags["tree"] == tree.name then @@ -162,6 +158,10 @@ function command_line.run_command(...) local root_dir = fs.absolute_name(flags["tree"]) replace_tree(flags, root_dir) end + elseif flags["project-tree"] then + local tree = flags["project-tree"] + table.insert(cfg.rocks_trees, 1, { name = "project", root = tree } ) + path.use_tree(tree) elseif flags["local"] then if not cfg.home_tree then die("The --local flag is meant for operating in a user's home directory.\n".. -- cgit v1.2.3-55-g6feb