From e467642476266b259be93ce6750bc27daeb57cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 18 Jun 2013 00:28:52 +0300 Subject: [PATCH] External deps_dir should have higher priority than the config one The external deps_dir should have higher priority because it is used by scripts and other build tools to set up the location of the dependencies. This commit ensures that, even if a project has set deps_dir in its config file has lower preference than the command line one. --- src/rebar_deps.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 313deaa..9f9fc5d 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -241,10 +241,11 @@ info_help(Description) -> %% Added because of trans deps, %% need all deps in same dir and should be the one set by the root rebar.config +%% In case one is given globally, it has higher priority %% Sets a default if root config has no deps_dir set set_shared_deps_dir(Config, []) -> - GlobalDepsDir = rebar_config:get_global(Config, deps_dir, "deps"), - DepsDir = rebar_config:get_local(Config, deps_dir, GlobalDepsDir), + LocalDepsDir = rebar_config:get_local(Config, deps_dir, "deps"), + DepsDir = rebar_config:get_global(Config, deps_dir, LocalDepsDir), rebar_config:set_xconf(Config, deps_dir, DepsDir); set_shared_deps_dir(Config, _DepsDir) -> Config.