From 4bb437512facac15a98e40c73b175beef9169dec Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Tue, 11 Mar 2014 22:10:05 -0400 Subject: [PATCH] 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. --- src/rebar_core.erl | 2 ++ src/rebar_deps.erl | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 81b9a6d..44b1d56 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -28,6 +28,8 @@ -export([process_commands/2, help/2]). +-export([execute_pre/5, execute_post/5]). + -include("rebar.hrl"). %% =================================================================== diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 43bde04..14ec3db 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -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: "