diff options
author | Pierre Fenoll <pierrefenoll@gmail.com> | 2018-02-23 13:06:39 +0100 |
---|---|---|
committer | Pierre Fenoll <pierrefenoll@gmail.com> | 2018-03-02 12:53:22 +0100 |
commit | 0d88ff8891d1545721b7b61bc866713a13d0905a (patch) | |
tree | c25b520e1c14dc65004d62b9f9915910087b803f /src | |
parent | 1d2aa24ef0d0bc6d1177cce361d7718f887eb03e (diff) |
do not append test profile if already there. Note that it comes from the prv list passed to providers:create/1
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_state.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 577ed23..ac77325 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -257,12 +257,15 @@ apply_profiles(State, Profile) when not is_list(Profile) -> apply_profiles(State, [default]) -> State; apply_profiles(State=#state_t{default = Defaults, current_profiles=CurrentProfiles}, Profiles) -> + IsTesting = lists:member(test, CurrentProfiles), AppliedProfiles = case Profiles of %% 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 is the head we must make sure not to prepend `default` [global | _] -> Profiles; + [test] when IsTesting -> + deduplicate(CurrentProfiles); _ -> deduplicate(CurrentProfiles ++ Profiles) end, |