aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2015-05-16 16:36:05 -0500
committerTristan Sloughter <[email protected]>2015-05-16 16:36:30 -0500
commitf958bc281ca93061a4aae0d6a339f7e3807216ad (patch)
tree05f1740fbbb686acf8ab8b11f29648d4d1e4c921 /src
parent693dcb8ca37b6d839d82197eacac86681c427dc7 (diff)
downloadrelx-f958bc281ca93061a4aae0d6a339f7e3807216ad.tar.gz
relx-f958bc281ca93061a4aae0d6a339f7e3807216ad.tar.bz2
relx-f958bc281ca93061a4aae0d6a339f7e3807216ad.zip
fix add_providers config option for newest providers dep
Diffstat (limited to 'src')
-rw-r--r--src/rlx_config.erl26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/rlx_config.erl b/src/rlx_config.erl
index df08342..33e8f27 100644
--- a/src/rlx_config.erl
+++ b/src/rlx_config.erl
@@ -164,22 +164,9 @@ load_terms({lib_dirs, Dirs}, {ok, State}) ->
load_terms({hooks, Hooks}, {ok, State0}) ->
add_hooks(Hooks, State0);
load_terms({providers, Providers0}, {ok, State0}) ->
- Providers1 = gen_providers(Providers0, State0),
- case Providers1 of
- {_, E={error, _}} ->
- E;
- {Providers3, {ok, State3}} ->
- {ok, rlx_state:providers(State3, Providers3)}
- end;
+ gen_providers(Providers0, State0);
load_terms({add_providers, Providers0}, {ok, State0}) ->
- Providers1 = gen_providers(Providers0, State0),
- case Providers1 of
- {_, E={error, _}} ->
- E;
- {Providers3, {ok, State1}} ->
- ExistingProviders = rlx_state:providers(State1),
- {ok, rlx_state:providers(State1, ExistingProviders ++ Providers3)}
- end;
+ gen_providers(Providers0, State0);
load_terms({skip_apps, SkipApps0}, {ok, State0}) ->
{ok, rlx_state:skip_apps(State0, SkipApps0)};
load_terms({exclude_apps, ExcludeApps0}, {ok, State0}) ->
@@ -260,14 +247,13 @@ load_terms(InvalidTerm, _) ->
?RLX_ERROR({invalid_term, InvalidTerm}).
-spec gen_providers([module()], rlx_state:t()) ->
- {[providers:t()], {ok, rlx_state:t()} | relx:error()}.
+ {ok, rlx_state:t()} | relx:error().
gen_providers(Providers, State) ->
- lists:foldl(fun(ProviderName, {Providers1, {ok, State1}}) ->
- {Provider, State2} = providers:new(ProviderName, State1),
- {[Provider | Providers1], State2};
+ lists:foldl(fun(ProviderName, {ok, State1}) ->
+ providers:new(ProviderName, State1);
(_, E={_, {error, _}}) ->
E
- end, {[], {ok, State}}, Providers).
+ end, {ok, State}, Providers).
add_hooks(Hooks, State) ->
{ok, lists:foldl(fun({pre, Target, Hook}, StateAcc) ->