summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-31 15:50:14 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-31 15:50:14 -0500
commit33e0612a75d0cc7f1e023c897af305bc4b00faa6 (patch)
treed8c148f134827c15b512e4c9b8d4b5bd83f5290f /src
parentb9b4e12600999cf2a2da4211508009ac7db96568 (diff)
run pre and post hooks for release and tar providers
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_release.erl4
-rw-r--r--src/rebar_prv_tar.erl4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rebar_prv_release.erl b/src/rebar_prv_release.erl
index f94f90d..982b392 100644
--- a/src/rebar_prv_release.erl
+++ b/src/rebar_prv_release.erl
@@ -40,6 +40,9 @@ do(State) ->
[?DEFAULT_CHECKOUTS_DIR, DepsDir | ProjectAppDirs]),
OutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR),
AllOptions = string:join(["release" | Options], " "),
+ Cwd = rebar_state:dir(State),
+ Providers = rebar_state:providers(State),
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
try
case rebar_state:get(State, relx, []) of
[] ->
@@ -52,6 +55,7 @@ do(State) ->
,{output_dir, OutputDir}
,{caller, Caller}], AllOptions)
end,
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
{ok, State}
catch
throw:T ->
diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl
index 84fe395..0c04d72 100644
--- a/src/rebar_prv_tar.erl
+++ b/src/rebar_prv_tar.erl
@@ -40,6 +40,9 @@ do(State) ->
[?DEFAULT_CHECKOUTS_DIR, DepsDir | ProjectAppDirs]),
OutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR),
AllOptions = string:join(["release", "tar" | Options], " "),
+ Cwd = rebar_state:dir(State),
+ Providers = rebar_state:providers(State),
+ rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State),
case rebar_state:get(State, relx, []) of
[] ->
relx:main([{lib_dirs, LibDirs}
@@ -51,6 +54,7 @@ do(State) ->
,{output_dir, OutputDir}
,{caller, Caller}], AllOptions)
end,
+ rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
{ok, State}.
-spec format_error(any()) -> iolist().