mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix bug 770
This commit is contained in:
parent
422beee324
commit
46b2c0612e
1 changed files with 10 additions and 2 deletions
|
@ -80,7 +80,7 @@ app_name(AppFile) ->
|
||||||
app_applications(AppFile) ->
|
app_applications(AppFile) ->
|
||||||
case load_app_file(AppFile) of
|
case load_app_file(AppFile) of
|
||||||
{ok, _, AppInfo} ->
|
{ok, _, AppInfo} ->
|
||||||
proplists:get_value(applications, AppInfo);
|
get_value(applications, AppInfo, AppFile);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ABORT("Failed to extract applications from ~s: ~p\n",
|
?ABORT("Failed to extract applications from ~s: ~p\n",
|
||||||
[AppFile, Reason])
|
[AppFile, Reason])
|
||||||
|
@ -89,7 +89,7 @@ app_applications(AppFile) ->
|
||||||
app_vsn(AppFile) ->
|
app_vsn(AppFile) ->
|
||||||
case load_app_file(AppFile) of
|
case load_app_file(AppFile) of
|
||||||
{ok, _, AppInfo} ->
|
{ok, _, AppInfo} ->
|
||||||
proplists:get_value(vsn, AppInfo);
|
get_value(vsn, AppInfo, AppFile);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ABORT("Failed to extract vsn from ~s: ~p\n",
|
?ABORT("Failed to extract vsn from ~s: ~p\n",
|
||||||
[AppFile, Reason])
|
[AppFile, Reason])
|
||||||
|
@ -116,3 +116,11 @@ load_app_file(Filename) ->
|
||||||
{AppName, AppData} ->
|
{AppName, AppData} ->
|
||||||
{ok, AppName, AppData}
|
{ok, AppName, AppData}
|
||||||
end.
|
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.
|
||||||
|
|
Loading…
Reference in a new issue