瀏覽代碼

Merge pull request #1716 from fenollp/sort-as

sort-as: force an order on multiple profiles
pull/1737/head
Fred Hebert 7 年之前
committed by GitHub
父節點
當前提交
b37737a63c
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 4 行新增1 行删除
  1. +3
    -0
      src/rebar_state.erl
  2. +1
    -1
      test/rebar_profiles_SUITE.erl

+ 3
- 0
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,

+ 1
- 1
test/rebar_profiles_SUITE.erl 查看文件

@ -211,7 +211,7 @@ implicit_profile_deduplicate_deps(Config) ->
rebar_test_utils:run_and_check(Config, RebarConfig,
["as", "test,bar", "eunit"], {ok, [{app, Name}
,{dep, "a", "1.0.0"}
,{dep, "b", "2.0.0"}]}).
,{dep, "b", "1.0.0"}]}).
all_deps_code_paths(Config) ->
AppDir = ?config(apps, Config),

Loading…
取消
儲存