diff options
-rw-r--r-- | src/luarocks/command_line.lua | 14 |
1 files 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(...) | |||
144 | 144 | ||
145 | if flags["project-tree"] then | 145 | if flags["project-tree"] then |
146 | table.insert(cfg.rocks_trees, 1, { name = "project", root = flags["project-tree"] } ) | 146 | table.insert(cfg.rocks_trees, 1, { name = "project", root = flags["project-tree"] } ) |
147 | else | ||
148 | local project_dir, rocks_tree = find_project_dir() | ||
149 | if project_dir then | ||
150 | table.insert(cfg.rocks_trees, 1, { name = "project", root = rocks_tree } ) | ||
151 | end | ||
147 | end | 152 | end |
148 | 153 | ||
149 | if flags["tree"] then | 154 | if flags["tree"] then |
@@ -170,13 +175,8 @@ function command_line.run_command(...) | |||
170 | end | 175 | end |
171 | replace_tree(flags, cfg.home_tree) | 176 | replace_tree(flags, cfg.home_tree) |
172 | else | 177 | else |
173 | local project_dir, rocks_tree = find_project_dir() | 178 | local trees = cfg.rocks_trees |
174 | if project_dir then | 179 | path.use_tree(trees[#trees]) |
175 | path.use_tree(rocks_tree) | ||
176 | else | ||
177 | local trees = cfg.rocks_trees | ||
178 | path.use_tree(trees[#trees]) | ||
179 | end | ||
180 | end | 180 | end |
181 | 181 | ||
182 | if type(cfg.root_dir) == "string" then | 182 | if type(cfg.root_dir) == "string" then |