diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-05-22 12:11:22 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-05-22 12:54:35 -0500 |
commit | be79d410935d790d921e074fcf7d6f1ec67cab55 (patch) | |
tree | 7fbc51fbf4c267d481c0ee2af7931244dbca436d /src | |
parent | 8ad6939939bd59dc8cc0775c7a75c3a97b7d1b9c (diff) |
have .app.src take precedence over .app file
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. |