summaryrefslogtreecommitdiff
path: root/src/rebar_app_discover.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-08-12 23:01:58 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-08-12 23:01:58 -0500
commit679acf994a71db39d502add1650852f535cbce00 (patch)
treeee030b66102d245094d450160e864a26d02bf6f6 /src/rebar_app_discover.erl
parent1001eefc2b0f0979c1a07fc309625ee04df60910 (diff)
parentecf6ad552444fa4e786bcd3959079033aff2ab7b (diff)
Merge pull request #696 from tsloughter/dialyzering
fix dialyzer warnings, except 'no local return' warnings
Diffstat (limited to 'src/rebar_app_discover.erl')
-rw-r--r--src/rebar_app_discover.erl15
1 files changed, 5 insertions, 10 deletions
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}}).