diff options
author | Tim Watson <watson.timothy@gmail.com> | 2011-09-06 09:51:38 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-10-05 13:49:27 +0200 |
commit | 30d1cdb31bbcc573cf3f31e67fdf0c1140b731fc (patch) | |
tree | 7594315493874c612fede7b82421f2c0662d430a /src | |
parent | 0279cb2fb9a96a5a79393d424ed087e5909645e8 (diff) |
Fix config handling in root_dir
Avoid overwriting custom config (passed with -C) when we are processing
the base_dir in rebar_core.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_core.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 5030f06..832bb32 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -102,7 +102,7 @@ process_dir(Dir, ParentConfig, Command, DirSet) -> true -> ?DEBUG("Entering ~s\n", [Dir]), ok = file:set_cwd(Dir), - Config = rebar_config:new(ParentConfig), + Config = maybe_load_local_config(Dir, ParentConfig), %% Save the current code path and then update it with %% lib_dirs. Children inherit parents code path, but we @@ -184,7 +184,18 @@ process_dir(Dir, ParentConfig, Command, DirSet) -> DirSet4 end. +maybe_load_local_config(Dir, ParentConfig) -> + %% We need to ensure we don't overwrite custom + %% config when we are dealing with base_dir. + case processing_base_dir(Dir) of + true -> + ParentConfig; + false -> + rebar_config:new(ParentConfig) + end. +processing_base_dir(Dir) -> + Dir == rebar_config:get_global(base_dir, undefined). %% %% Given a list of directories and a set of previously processed directories, |