Browse Source

do not append test profile if already there. Note that it comes from the prv list passed to providers:create/1

pull/1716/head
Pierre Fenoll 7 years ago
parent
commit
0d88ff8891
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/rebar_state.erl

+ 3
- 0
src/rebar_state.erl View File

@ -257,12 +257,15 @@ apply_profiles(State, Profile) when not is_list(Profile) ->
apply_profiles(State, [default]) -> apply_profiles(State, [default]) ->
State; State;
apply_profiles(State=#state_t{default = Defaults, current_profiles=CurrentProfiles}, Profiles) -> apply_profiles(State=#state_t{default = Defaults, current_profiles=CurrentProfiles}, Profiles) ->
IsTesting = lists:member(test, CurrentProfiles),
AppliedProfiles = case Profiles of AppliedProfiles = case Profiles of
%% Head of list global profile is special, only for use by rebar3 %% Head of list global profile is special, only for use by rebar3
%% It does not clash if a user does `rebar3 as global...` but when %% It does not clash if a user does `rebar3 as global...` but when
%% it is the head we must make sure not to prepend `default` %% it is the head we must make sure not to prepend `default`
[global | _] -> [global | _] ->
Profiles; Profiles;
[test] when IsTesting ->
deduplicate(CurrentProfiles);
_ -> _ ->
deduplicate(CurrentProfiles ++ Profiles) deduplicate(CurrentProfiles ++ Profiles)
end, end,

Loading…
Cancel
Save