From cb14a33fdd9eb7e4bf0cacde52c3027910de34b3 Mon Sep 17 00:00:00 2001 From: "Viacheslav V. Kovalev" Date: Sun, 19 Apr 2015 16:24:43 +0300 Subject: Do not duplicate profile when applying. --- src/rebar_state.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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}. -- cgit v1.1