summaryrefslogtreecommitdiff
path: root/src/rebar_core.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_core.erl')
-rw-r--r--src/rebar_core.erl13
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,