From 42339f62f3e7bad759d595a08ac4583a5faad30d Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 21 May 2015 22:40:58 -0500 Subject: only run clean hooks once --- src/rebar_prv_clean.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl index 8fafe23..272ac26 100644 --- a/src/rebar_prv_clean.erl +++ b/src/rebar_prv_clean.erl @@ -67,8 +67,13 @@ format_error(Reason) -> clean_apps(State, Providers, Apps) -> lists:foreach(fun(AppInfo) -> AppDir = rebar_app_info:dir(AppInfo), - C = rebar_config:consult(AppDir), - S = rebar_state:new(State, C, AppDir), + S = case rebar_app_info:state(AppInfo) of + undefined -> + C = rebar_config:consult(AppDir), + rebar_state:new(State, C, AppDir); + AppState -> + AppState + end, ?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]), %% Legacy hook support -- cgit v1.1