diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-03-30 07:52:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 07:52:12 -0700 |
commit | b37737a63c67589a2aedeb7dff3d212ea4e87753 (patch) | |
tree | 7a8b653f7657339bb4d6288f84db9f82d50afc07 /src | |
parent | 8b061497e2db39b17323c35dc8c020b67c5032fc (diff) | |
parent | 1271458c511100a5402a7aec94e48904ad792ac7 (diff) |
Merge pull request #1716 from fenollp/sort-as
sort-as: force an order on multiple profiles
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..dd1f43f 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) -> + 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; + _ when ProvidedProfiles -> + deduplicate(CurrentProfiles); _ -> deduplicate(CurrentProfiles ++ Profiles) end, |