diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-08-23 14:23:58 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-08-23 14:23:58 -0500 |
commit | f2f63013fedbde4ea1de0ae09d767eb92eb1a5d2 (patch) | |
tree | 639cc2a71ebe37ed129c79e119ef12d6516b0af3 /src | |
parent | 657a1bf52e4de27d3d302de707fdd53fa3d0632e (diff) |
override 'deps' now automatically overrides '{deps,default}'
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_state.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index f365293..6feae81 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -242,7 +242,9 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> %% Inefficient. We want the order we get here though. State1 = lists:foldl(fun({override, O}, StateAcc) -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + rebar_state:set(StateAcc1, {deps,default}, Value); + ({Key, Value}, StateAcc1) -> rebar_state:set(StateAcc1, Key, Value) end, StateAcc, O); (_, StateAcc) -> @@ -250,7 +252,9 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> end, State, Overrides), State2 = lists:foldl(fun({override, N, O}, StateAcc) when N =:= Name -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + rebar_state:set(StateAcc1, {deps,default}, Value); + ({Key, Value}, StateAcc1) -> rebar_state:set(StateAcc1, Key, Value) end, StateAcc, O); (_, StateAcc) -> @@ -258,7 +262,10 @@ apply_overrides(State=#state_t{overrides=Overrides}, AppName) -> end, State1, Overrides), State3 = lists:foldl(fun({add, N, O}, StateAcc) when N =:= Name -> - lists:foldl(fun({Key, Value}, StateAcc1) -> + lists:foldl(fun({deps, Value}, StateAcc1) -> + OldValue = rebar_state:get(StateAcc1, {deps,default}, []), + rebar_state:set(StateAcc1, {deps,default}, Value++OldValue); + ({Key, Value}, StateAcc1) -> OldValue = rebar_state:get(StateAcc1, Key, []), rebar_state:set(StateAcc1, Key, Value++OldValue) end, StateAcc, O); |