diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-31 17:23:54 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-31 17:23:54 -0400 |
commit | 5a3e3bdc303f3578015e372b1fa5e1b22b303d46 (patch) | |
tree | d8c148f134827c15b512e4c9b8d4b5bd83f5290f /src | |
parent | 44a700ef780e641e49d6ea4f6ab2c8831babd96a (diff) | |
parent | 33e0612a75d0cc7f1e023c897af305bc4b00faa6 (diff) |
Merge pull request #490 from tsloughter/release_hooks
run pre and post hooks for release and tar providers
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_release.erl | 4 | ||||
-rw-r--r-- | src/rebar_prv_tar.erl | 4 |
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(). |