diff options
author | Jordan Wilberding <[email protected]> | 2015-05-18 19:29:21 -0700 |
---|---|---|
committer | Jordan Wilberding <[email protected]> | 2015-05-18 19:29:21 -0700 |
commit | 74fec3455ba6dbb7d9e369137c1b15ab10804993 (patch) | |
tree | fdbd528f26a32e366257bda78ef118fcc0c5bfa3 /src | |
parent | fbd2317b3f26f7cbd96a0f944f7ef3a3702e1f67 (diff) | |
parent | f958bc281ca93061a4aae0d6a339f7e3807216ad (diff) | |
download | relx-74fec3455ba6dbb7d9e369137c1b15ab10804993.tar.gz relx-74fec3455ba6dbb7d9e369137c1b15ab10804993.tar.bz2 relx-74fec3455ba6dbb7d9e369137c1b15ab10804993.zip |
Merge pull request #345 from tsloughter/master
fix add_providers config option for newest providers dep
Diffstat (limited to 'src')
-rw-r--r-- | src/rlx_config.erl | 26 |
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) -> |