From 639bd13aecd3ca9f4237790264728dabaad50db0 Mon Sep 17 00:00:00 2001 From: Mikhail Kalashnikov Date: Wed, 26 Jul 2017 12:08:17 +0300 Subject: Fix cleanup_code_path for xref compile hook --- src/rebar_prv_xref.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_xref.erl b/src/rebar_prv_xref.erl index e6a074f..db0f4e4 100644 --- a/src/rebar_prv_xref.erl +++ b/src/rebar_prv_xref.erl @@ -36,6 +36,7 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> + OldPath = code:get_path(), code:add_pathsa(rebar_state:code_paths(State, all_deps)), XrefChecks = prepare(State), XrefIgnores = rebar_state:get(State, xref_ignores, []), @@ -47,7 +48,7 @@ do(State) -> QueryChecks = rebar_state:get(State, xref_queries, []), QueryResults = lists:foldl(fun check_query/2, [], QueryChecks), stopped = xref:stop(xref), - rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)), + rebar_utils:cleanup_code_path(OldPath), case XrefResults =:= [] andalso QueryResults =:= [] of true -> {ok, State}; -- cgit v1.1