Skip to content

Commit

Permalink
sort-as: a more general pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Feb 25, 2018
1 parent a1a2465 commit 5b01b36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rebar_state.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b01b36

Please sign in to comment.