summaryrefslogtreecommitdiff
path: root/src/rebar_app_info.erl
diff options
context:
space:
mode:
authorViacheslav V. Kovalev <kovyl2404@gmail.com>2015-05-01 00:23:51 +0300
committerViacheslav V. Kovalev <kovyl2404@gmail.com>2015-05-01 00:23:51 +0300
commit33736f32a9a8bfd30711270e8f1376280915d697 (patch)
tree11924915352287650253a73ae7254af241c07625 /src/rebar_app_info.erl
parent29a855d31c7fe7fd7504f5d0ec95c9a55e27276f (diff)
parent7645a1118f0e5cdc27e010905f5072021559ddfd (diff)
Merge branch 'master' into app-discover-profile-duplication
Conflicts: test/rebar_profiles_SUITE.erl
Diffstat (limited to 'src/rebar_app_info.erl')
-rw-r--r--src/rebar_app_info.erl15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 9659c0b..91640f2 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -61,7 +61,7 @@
%%============================================================================
%% types
%%============================================================================
--type t() :: record(app_info_t).
+-type t() :: #app_info_t{}.
%%============================================================================
%% API
@@ -157,6 +157,19 @@ app_file(AppInfo=#app_info_t{}, AppFile) ->
AppInfo#app_info_t{app_file=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,
+ case file:consult(AppFile) of
+ {ok, [{application, _, AppDetails}]} ->
+ AppDetails;
+ _ ->
+ []
+ end;
app_details(#app_info_t{app_details=AppDetails}) ->
AppDetails.