diff options
Diffstat (limited to 'src/rebar_prv_clean.erl')
-rw-r--r-- | src/rebar_prv_clean.erl | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl index f10d12b..8bdea4d 100644 --- a/src/rebar_prv_clean.erl +++ b/src/rebar_prv_clean.erl @@ -44,10 +44,7 @@ do(State) -> DepApps = [] end, - %% Need to allow global config vars used on deps - %% Right now no way to differeniate and just give deps a new state - EmptyState = rebar_state:new(), - clean_apps(EmptyState, Providers, DepApps), + clean_apps(State, Providers, DepApps), Cwd = rebar_dir:get_cwd(), rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State), @@ -65,15 +62,13 @@ format_error(Reason) -> %% =================================================================== clean_apps(State, Providers, Apps) -> - lists:foreach(fun(AppInfo) -> - AppDir = rebar_app_info:dir(AppInfo), - S = rebar_app_info:state_or_new(State, AppInfo), - - ?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]), - rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, S), - rebar_erlc_compiler:clean(State, rebar_app_info:out_dir(AppInfo)), - rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, S) - end, Apps). + [begin + ?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]), + AppDir = rebar_app_info:dir(AppInfo), + AppInfo1 = rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, AppInfo, State), + rebar_erlc_compiler:clean(State, rebar_app_info:out_dir(AppInfo1)), + rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, AppInfo1, State) + end || AppInfo <- Apps]. handle_args(State) -> {Args, _} = rebar_state:command_parsed_args(State), |