Sfoglia il codice sorgente

Add caching of app file

Dave Smith 15 anni fa
parent
commit
c28a16258c
1 ha cambiato i file con 13 aggiunte e 7 eliminazioni
  1. +13
    -7
      src/rebar_app_utils.erl

+ 13
- 7
src/rebar_app_utils.erl Vedi File

@ -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.

Caricamento…
Annulla
Salva