瀏覽代碼

Normalize return values of app_info data

The parsing functions were used inconsistently, and the returned values
were bad in some clauses; things only worked because they are never used
within rebar3. This ensures the return types are consistent on all
clauses.
pull/1640/head
Fred Hebert 7 年之前
父節點
當前提交
1ef0ed5b2d
共有 1 個文件被更改,包括 11 次插入4 次删除
  1. +11
    -4
      src/rebar_app_info.erl

+ 11
- 4
src/rebar_app_info.erl 查看文件

@ -311,15 +311,22 @@ app_file(AppInfo=#app_info_t{}, AppFile) ->
app_details(AppInfo=#app_info_t{app_details=[]}) -> app_details(AppInfo=#app_info_t{app_details=[]}) ->
case app_file(AppInfo) of case app_file(AppInfo) of
undefined -> undefined ->
rebar_file_utils:try_consult(app_file_src(AppInfo));
case rebar_config:consult_app_file(app_file_src(AppInfo)) of
[] -> [];
[{application, _Name, AppDetails}] -> AppDetails
end;
AppFile -> AppFile ->
try
rebar_file_utils:try_consult(AppFile)
try rebar_file_utils:try_consult(AppFile) of
[] -> [];
[{application, _Name, AppDetails}] -> AppDetails
catch catch
throw:{error, {Module, Reason}} -> throw:{error, {Module, Reason}} ->
?DEBUG("Warning, falling back to .app.src because of: ~ts", ?DEBUG("Warning, falling back to .app.src because of: ~ts",
[Module:format_error(Reason)]), [Module:format_error(Reason)]),
rebar_file_utils:try_consult(app_file_src(AppInfo))
case rebar_config:consult_app_file(app_file_src(AppInfo)) of
[] -> [];
[{application, _Name, AppDetails}] -> AppDetails
end
end end
end; end;
app_details(#app_info_t{app_details=AppDetails}) -> app_details(#app_info_t{app_details=AppDetails}) ->

Loading…
取消
儲存