diff options
author | Viacheslav V. Kovalev <kovyl2404@gmail.com> | 2015-04-19 16:24:43 +0300 |
---|---|---|
committer | Viacheslav V. Kovalev <kovyl2404@gmail.com> | 2015-04-19 16:24:43 +0300 |
commit | cb14a33fdd9eb7e4bf0cacde52c3027910de34b3 (patch) | |
tree | a0332d42f07db883870f57951a48c0fac1b3e34d | |
parent | 123b0ea61afd5d1524d0c08b5e8ebcc3b01f0866 (diff) |
Do not duplicate profile when applying.
-rw-r--r-- | src/rebar_state.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index f922977..7d872ee 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -213,8 +213,12 @@ apply_profiles(State=#state_t{opts=Opts, current_profiles=CurrentProfiles}, Prof lists:foldl(fun(default, {ProfilesAcc, OptsAcc}) -> {ProfilesAcc, OptsAcc}; (Profile, {ProfilesAcc, OptsAcc}) -> + NewProfilesAcc = case lists:member(Profile, CurrentProfiles) of + false -> [Profile]++ProfilesAcc; + true -> ProfilesAcc + end, ProfileOpts = dict:from_list(proplists:get_value(Profile, ConfigProfiles, [])), - {[Profile]++ProfilesAcc, merge_opts(Profile, ProfileOpts, OptsAcc)} + {NewProfilesAcc, merge_opts(Profile, ProfileOpts, OptsAcc)} end, {[], Opts}, Profiles), State#state_t{current_profiles=CurrentProfiles++Profiles1, opts=NewOpts}. |