diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-05-22 20:46:03 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-05-22 20:46:03 -0500 |
commit | d9bad345062ec29d748d77c1497232b769a379d0 (patch) | |
tree | 7b1f4a283dc00b61f49c21a06b4f054a13c317d3 /src/rebar_prv_clean.erl | |
parent | b4786b804c8b31a220e9daea753bd0ec3f7a62dd (diff) | |
parent | 8a50331898e3c5def85a3c7158c7cefe22a36a5f (diff) |
Merge pull request #472 from tsloughter/refactor_hooks
move handling of undefined app state to function
Diffstat (limited to 'src/rebar_prv_clean.erl')
-rw-r--r-- | src/rebar_prv_clean.erl | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl index 272ac26..666ae13 100644 --- a/src/rebar_prv_clean.erl +++ b/src/rebar_prv_clean.erl @@ -67,16 +67,9 @@ format_error(Reason) -> clean_apps(State, Providers, Apps) -> lists:foreach(fun(AppInfo) -> AppDir = rebar_app_info:dir(AppInfo), - S = case rebar_app_info:state(AppInfo) of - undefined -> - C = rebar_config:consult(AppDir), - rebar_state:new(State, C, AppDir); - AppState -> - AppState - end, + S = rebar_app_info:state_or_new(State, AppInfo), ?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]), - %% Legacy hook support 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) |