summaryrefslogtreecommitdiff
path: root/check_xref
diff options
context:
space:
mode:
Diffstat (limited to 'check_xref')
-rwxr-xr-xcheck_xref24
1 files changed, 14 insertions, 10 deletions
diff --git a/check_xref b/check_xref
index 6eb89e15..8f65f3b1 100755
--- a/check_xref
+++ b/check_xref
@@ -34,14 +34,18 @@ main([PluginsDir|Argv]) ->
false -> ok;
true -> os:cmd("rm -rf " ++ LibDir)
end,
-
- try
- check(Cwd, PluginsDir, LibDir, checks())
- after
- %% TODO: bootstrap file_handle_cache and use
- %% rabbit_file:recursive_delete instead of this...
- os:cmd("rm -rf " ++ LibDir)
- end.
+ Rc = try
+ check(Cwd, PluginsDir, LibDir, checks())
+ catch
+ _:Err ->
+ io:format(user, "failed: ~p~n", [Err]),
+ 1
+ end,
+ shutdown(Rc, LibDir).
+
+shutdown(Rc, LibDir) ->
+ os:cmd("rm -rf " ++ LibDir),
+ erlang:halt(Rc).
check(Cwd, PluginsDir, LibDir, Checks) ->
{ok, Plugins} = file:list_dir(PluginsDir),
@@ -220,8 +224,8 @@ report(Results) ->
report(info, "Completed: ~p errors, ~p warnings~n",
[length(Errors), length(Warnings)]),
case length(Errors) > 0 of
- true -> halt(1);
- false -> halt(0)
+ true -> 1;
+ false -> 0
end.
report_failures({analysis_error, {Mod, Reason}}) ->