diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_app_info.erl | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl index 382ea7a..1b87e0b 100644 --- a/src/rebar_app_info.erl +++ b/src/rebar_app_info.erl @@ -41,6 +41,8 @@ valid/1, valid/2]). +-include("rebar.hrl"). + -export_type([t/0]). -record(app_info_t, {name :: binary(), @@ -161,13 +163,19 @@ app_file(AppInfo=#app_info_t{}, AppFile) -> -spec app_details(t()) -> list(). app_details(AppInfo=#app_info_t{app_details=[]}) -> - AppFile = case app_file(AppInfo) of - undefined -> - app_file_src(AppInfo); - File -> - File - end, - rebar_file_utils:try_consult(AppFile); + case app_file(AppInfo) of + undefined -> + rebar_file_utils:try_consult(app_file_src(AppInfo)); + AppFile -> + try + rebar_file_utils:try_consult(AppFile) + catch + throw:{error, {Module, Reason}} -> + ?DEBUG("Warning, falling back to .app.src because of: ~s", + [Module:format_error(Reason)]), + rebar_file_utils:try_consult(app_file_src(AppInfo)) + end + end; app_details(#app_info_t{app_details=AppDetails}) -> AppDetails. |