浏览代码

sort-as: a more general pattern

pull/1716/head
Pierre Fenoll 7 年前
父节点
当前提交
1271458c51
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      src/rebar_state.erl

+ 2
- 2
src/rebar_state.erl 查看文件

@ -257,14 +257,14 @@ 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),
ProvidedProfiles = lists:prefix([default|Profiles], 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 ->
_ when ProvidedProfiles ->
deduplicate(CurrentProfiles); deduplicate(CurrentProfiles);
_ -> _ ->
deduplicate(CurrentProfiles ++ Profiles) deduplicate(CurrentProfiles ++ Profiles)

正在加载...
取消
保存