From 0bd49634ce58fcc4bcef1838604cb9a548192ad9 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 21 May 2015 19:03:08 -0500 Subject: don't lose global plugin providers --- src/rebar3.erl | 6 +++--- src/rebar_dir.erl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rebar3.erl b/src/rebar3.erl index 523b8b0..2e4018f 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -145,12 +145,12 @@ init_config() -> %% We don't want to worry about global plugin install state effecting later %% usage. So we throw away the global profile state used for plugin install. GlobalConfigThrowAway = rebar_state:current_profiles(GlobalConfig, ["global"]), - rebar_plugins:handle_plugins(global, + GlobalState = rebar_plugins:handle_plugins(global, rebar_state:get(GlobalConfigThrowAway, plugins, []), GlobalConfigThrowAway), - + GlobalPlugins = rebar_state:providers(GlobalState), GlobalConfig2 = rebar_state:set(GlobalConfig, plugins, []), - rebar_state:new(GlobalConfig2, Config1); + rebar_state:providers(rebar_state:new(GlobalConfig2, Config1), GlobalPlugins); false -> rebar_state:new(Config1) end, diff --git a/src/rebar_dir.erl b/src/rebar_dir.erl index 9bff2ab..e810912 100644 --- a/src/rebar_dir.erl +++ b/src/rebar_dir.erl @@ -34,7 +34,7 @@ base_dir(State) -> -spec profile_dir(rebar_state:t(), [atom()]) -> file:filename_all(). profile_dir(State, Profiles) -> {BaseDir, ProfilesStrings} = case [ec_cnv:to_list(P) || P <- Profiles] of - ["global"] -> {?MODULE:global_cache_dir(State), [""]}; + ["global" | _] -> {?MODULE:global_cache_dir(State), [""]}; ["default"] -> {rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), ["default"]}; %% drop `default` from the profile dir if it's implicit and reverse order %% of profiles to match order passed to `as` -- cgit v1.1