summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2011-01-07 12:40:02 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-01-08 19:20:40 +0100
commit46b2c0612e893a5bf34ec720810a9bd52928fd63 (patch)
tree6d046f7700a6281c3a349ef8566e3c0c171f28d3
parent422beee324e24d5db404b9f61d26cceb73a9fcce (diff)
Fix bug 770
-rw-r--r--src/rebar_app_utils.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl
index 9574775..ea8e079 100644
--- a/src/rebar_app_utils.erl
+++ b/src/rebar_app_utils.erl
@@ -80,7 +80,7 @@ app_name(AppFile) ->
app_applications(AppFile) ->
case load_app_file(AppFile) of
{ok, _, AppInfo} ->
- proplists:get_value(applications, AppInfo);
+ get_value(applications, AppInfo, AppFile);
{error, Reason} ->
?ABORT("Failed to extract applications from ~s: ~p\n",
[AppFile, Reason])
@@ -89,7 +89,7 @@ app_applications(AppFile) ->
app_vsn(AppFile) ->
case load_app_file(AppFile) of
{ok, _, AppInfo} ->
- proplists:get_value(vsn, AppInfo);
+ get_value(vsn, AppInfo, AppFile);
{error, Reason} ->
?ABORT("Failed to extract vsn from ~s: ~p\n",
[AppFile, Reason])
@@ -116,3 +116,11 @@ load_app_file(Filename) ->
{AppName, AppData} ->
{ok, AppName, AppData}
end.
+
+get_value(Key, AppInfo, AppFile) ->
+ case proplists:get_value(Key, AppInfo) of
+ undefined ->
+ ?ABORT("Failed to get app value '~p' from '~s'~n", [Key, AppFile]);
+ Value ->
+ Value
+ end.