summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-10-27 19:13:52 -0500
committerTristan Sloughter <t@crashfast.com>2015-10-27 19:15:14 -0500
commit3f7886abe0e88c6737d80804dec0eef89b1940db (patch)
treeef2df5b0187f374570af869ea59156c6ba242432 /src
parentc88c373e49aa19ebf7e459d7b29eeb86d3ad8d1e (diff)
only clean project apps once even when doing --all
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_clean.erl16
1 files changed, 8 insertions, 8 deletions
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}.