Actually run the hooks, not just the plugins

This commit is contained in:
Andrew Thompson 2014-03-12 00:42:50 -04:00
parent 4bb437512f
commit f911f8f99c
2 changed files with 15 additions and 5 deletions

View file

@ -28,7 +28,7 @@
-export([process_commands/2, help/2]). -export([process_commands/2, help/2]).
-export([execute_pre/5, execute_post/5]). -export([execute_pre/5, execute_post/5, apply_hooks/4]).
-include("rebar.hrl"). -include("rebar.hrl").

View file

@ -565,20 +565,30 @@ update_source(Config, Dep) ->
true -> true ->
?CONSOLE("Updating ~p from ~p\n", [Dep#dep.app, Dep#dep.source]), ?CONSOLE("Updating ~p from ~p\n", [Dep#dep.app, Dep#dep.source]),
%% Check for and get command specific environments %% Check for and get command specific environments
Env = setup_env(Config), {ok, CWD} = file:get_cwd(),
ok = file:set_cwd(AppDir),
Config1 = rebar_config:new(Config),
Env = setup_env(Config1),
{true, ModuleSetFile} = rebar_app_utils:is_app_dir(AppDir), {true, ModuleSetFile} = rebar_app_utils:is_app_dir(AppDir),
%% Execute any before_command plugins on this directory %% Execute any before_command plugins on this directory
Config1 = rebar_core:execute_pre('update-deps', [], Config2 = rebar_core:execute_pre('update-deps', [],
Config, ModuleSetFile, Env), Config1, ModuleSetFile, Env),
rebar_core:apply_hooks(pre_hooks, Config2, 'update-deps', Env),
require_source_engine(Dep#dep.source), require_source_engine(Dep#dep.source),
update_source1(AppDir, Dep#dep.source), update_source1(AppDir, Dep#dep.source),
rebar_core:apply_hooks(post_hooks, Config2, 'update-deps', Env),
%% Execute any after_command plugins on this directory %% Execute any after_command plugins on this directory
rebar_core:execute_post('update-deps', [], rebar_core:execute_post('update-deps', [],
Config1, ModuleSetFile, Env), Config2, ModuleSetFile, Env),
ok = file:set_cwd(CWD),
Dep; Dep;
false -> false ->
?WARN("Skipping update for ~p: " ?WARN("Skipping update for ~p: "