浏览代码

Add caching of app file

Dave Smith 15 年前
父节点
当前提交
c28a16258c
共有 1 个文件被更改,包括 13 次插入7 次删除
  1. +13
    -7
      src/rebar_app_utils.erl

+ 13
- 7
src/rebar_app_utils.erl 查看文件

@ -85,11 +85,17 @@ app_vsn(AppFile) ->
%% ===================================================================
load_app_file(Filename) ->
case file:consult(Filename) of
{ok, [{application, AppName, AppData}]} ->
{ok, AppName, AppData};
{error, Reason} ->
{error, Reason};
Other ->
{error, {unexpected_terms, Other}}
case erlang:get({app_file, Filename}) of
undefined ->
case file:consult(Filename) of
{ok, [{application, AppName, AppData}]} ->
erlang:put({app_file, Filename}, {AppName, AppData}),
{ok, AppName, AppData};
{error, Reason} ->
{error, Reason};
Other ->
{error, {unexpected_terms, Other}}
end;
{AppName, AppData} ->
{ok, AppName, AppData}
end.

正在加载...
取消
保存