From 3f7886abe0e88c6737d80804dec0eef89b1940db Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Tue, 27 Oct 2015 19:13:52 -0500 Subject: only clean project apps once even when doing --all --- src/rebar_prv_clean.erl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl index 6694dc0..7f952e3 100644 --- a/src/rebar_prv_clean.erl +++ b/src/rebar_prv_clean.erl @@ -33,23 +33,23 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> Providers = rebar_state:providers(State), - ProjectApps = rebar_state:project_apps(State), {all, All} = handle_args(State), + Cwd = rebar_dir:get_cwd(), + rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State), + case All of true -> DepsDir = rebar_dir:deps_dir(State), - DepApps = rebar_app_discover:find_apps([filename:join(DepsDir, "*")], all); + AllApps = rebar_app_discover:find_apps([filename:join(DepsDir, "*")], all), + clean_apps(State, Providers, AllApps); false -> - DepApps = [] + ProjectApps = rebar_state:project_apps(State), + clean_apps(State, Providers, ProjectApps) end, - clean_apps(State, Providers, DepApps), - - Cwd = rebar_dir:get_cwd(), - rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State), - clean_apps(State, Providers, ProjectApps), clean_extras(State), + rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State), {ok, State}. -- cgit v1.1