summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-17 14:36:03 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-17 14:36:03 -0500
commit3a201230fedb01ba258c291ed56450300caeac56 (patch)
tree77853d81ec2ed2c00be88fa23e7be553484df58c /src/rebar3.erl
parent162f0f8f63c99c6a9800ef1911060fad8b257b8b (diff)
install plugins from the global config to ~/.cache/plugins
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r--src/rebar3.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 1a02407..523b8b0 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -141,7 +141,16 @@ init_config() ->
?DEBUG("Load global config file ~p",
[GlobalConfigFile]),
GlobalConfig = rebar_state:new(rebar_config:consult_file(GlobalConfigFile)),
- rebar_state:new(GlobalConfig, Config1);
+
+ %% 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,
+ rebar_state:get(GlobalConfigThrowAway, plugins, []),
+ GlobalConfigThrowAway),
+
+ GlobalConfig2 = rebar_state:set(GlobalConfig, plugins, []),
+ rebar_state:new(GlobalConfig2, Config1);
false ->
rebar_state:new(Config1)
end,