Run pre/post hooks for update-deps

This is a bit of a kludge, but because we are operating outside of
rebar_core when doing update-deps it seems necessary.
This commit is contained in:
Andrew Thompson 2014-03-11 22:10:05 -04:00
parent 47c089aa80
commit 4bb437512f
2 changed files with 15 additions and 0 deletions

View file

@ -28,6 +28,8 @@
-export([process_commands/2, help/2]).
-export([execute_pre/5, execute_post/5]).
-include("rebar.hrl").
%% ===================================================================

View file

@ -564,8 +564,21 @@ update_source(Config, Dep) ->
case has_vcs_dir(element(1, Dep#dep.source), AppDir) of
true ->
?CONSOLE("Updating ~p from ~p\n", [Dep#dep.app, Dep#dep.source]),
%% Check for and get command specific environments
Env = setup_env(Config),
{true, ModuleSetFile} = rebar_app_utils:is_app_dir(AppDir),
%% Execute any before_command plugins on this directory
Config1 = rebar_core:execute_pre('update-deps', [],
Config, ModuleSetFile, Env),
require_source_engine(Dep#dep.source),
update_source1(AppDir, Dep#dep.source),
%% Execute any after_command plugins on this directory
rebar_core:execute_post('update-deps', [],
Config1, ModuleSetFile, Env),
Dep;
false ->
?WARN("Skipping update for ~p: "