From 6fde1748b9c7a67db1dbd1fb051d630c79656b3a Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 8 Aug 2015 14:17:03 -0500 Subject: fix dialyzer warnings, except 'no local return' warnings --- src/rebar_app_discover.erl | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/rebar_app_discover.erl') diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index c5a79a6..3b34539 100644 --- a/src/rebar_app_discover.erl +++ b/src/rebar_app_discover.erl @@ -138,7 +138,7 @@ find_app(AppDir, Validate) -> app_dir(AppFile) -> filename:join(rebar_utils:droplast(filename:split(filename:dirname(AppFile)))). --spec create_app_info(file:name(), file:name()) -> rebar_app_info:t() | {error, term()}. +-spec create_app_info(file:name(), file:name()) -> rebar_app_info:t(). create_app_info(AppDir, AppFile) -> [{application, AppName, AppDetails}] = rebar_config:consult_app_file(AppFile), AppVsn = proplists:get_value(vsn, AppDetails), @@ -208,16 +208,11 @@ try_handle_app_src_file(_, _AppDir, _AppSrcFile, valid) -> try_handle_app_src_file(_, AppDir, [File], Validate) when Validate =:= invalid ; Validate =:= all -> AppInfo = create_app_info(AppDir, File), - case AppInfo of - {error, Reason} -> - throw({error, {invalid_app_file, File, Reason}}); + case filename:extension(File) of + ".script" -> + {true, rebar_app_info:app_file_src_script(AppInfo, File)}; _ -> - case filename:extension(File) of - ".script" -> - {true, rebar_app_info:app_file_src_script(AppInfo, File)}; - _ -> - {true, rebar_app_info:app_file_src(AppInfo, File)} - end + {true, rebar_app_info:app_file_src(AppInfo, File)} end; try_handle_app_src_file(_, _AppDir, Other, _Validate) -> throw({error, {multiple_app_files, Other}}). -- cgit v1.1