From 6d22624e505d81ce58de2343a86c960518573e85 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 23 May 2018 14:54:44 -0300 Subject: do not detect a typical legacy $HOME as a project dir --- src/luarocks/command_line.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index 40ad06af..27965212 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua @@ -144,6 +144,11 @@ function command_line.run_command(...) if flags["project-tree"] then table.insert(cfg.rocks_trees, 1, { name = "project", root = flags["project-tree"] } ) + else + local project_dir, rocks_tree = find_project_dir() + if project_dir then + table.insert(cfg.rocks_trees, 1, { name = "project", root = rocks_tree } ) + end end if flags["tree"] then @@ -170,13 +175,8 @@ function command_line.run_command(...) end replace_tree(flags, cfg.home_tree) else - local project_dir, rocks_tree = find_project_dir() - if project_dir then - path.use_tree(rocks_tree) - else - local trees = cfg.rocks_trees - path.use_tree(trees[#trees]) - end + local trees = cfg.rocks_trees + path.use_tree(trees[#trees]) end if type(cfg.root_dir) == "string" then -- cgit v1.2.3-55-g6feb