summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Fenoll <pierrefenoll@gmail.com>2018-02-25 13:39:45 +0100
committerPierre Fenoll <pierrefenoll@gmail.com>2018-03-02 12:53:22 +0100
commit1271458c511100a5402a7aec94e48904ad792ac7 (patch)
treec41de1d3e322fc7fcdd1980ec074ac13da6144e1
parentcfe6dfcca5d6526d835531a81cb5bdc1a21c17b3 (diff)
sort-as: a more general pattern
-rw-r--r--src/rebar_state.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index ac77325..dd1f43f 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -257,14 +257,14 @@ 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),
+ ProvidedProfiles = lists:prefix([default|Profiles], 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 ->
+ _ when ProvidedProfiles ->
deduplicate(CurrentProfiles);
_ ->
deduplicate(CurrentProfiles ++ Profiles)