summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Morrow <jared@basho.com>2013-11-22 14:17:21 -0800
committerJared Morrow <jared@basho.com>2013-11-22 14:17:21 -0800
commit9a158d37fca07006c20222e5651a64fb7ddd6d01 (patch)
tree796230479dc14ec14ce07b93f36a0b5da6ec1813 /src
parent05f81eca8a297fe2cb67a4a2696c8f5c36187452 (diff)
parentaa46d858493356b5247481532145ddc99f12040d (diff)
Merge pull request #157 from Vagabond/adt-lib-dir
Don't over-aggressively clean the code path in the presence of lib_dir directives
Diffstat (limited to 'src')
-rw-r--r--src/rebar_core.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 4d50f4f..6c4f5c5 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -399,18 +399,19 @@ update_code_path(Config) ->
[] ->
no_change;
Paths ->
- OldPath = code:get_path(),
LibPaths = expand_lib_dirs(Paths, rebar_utils:get_cwd(), []),
ok = code:add_pathsa(LibPaths),
- {old, OldPath}
+ %% track just the paths we added, so we can remove them without
+ %% removing other paths added by this dep
+ {added, LibPaths}
end.
restore_code_path(no_change) ->
ok;
-restore_code_path({old, Path}) ->
+restore_code_path({added, Paths}) ->
%% Verify that all of the paths still exist -- some dynamically
%% added paths can get blown away during clean.
- true = code:set_path([F || F <- Path, erl_prim_loader_is_file(F)]),
+ [code:del_path(F) || F <- Paths, erl_prim_loader_is_file(F)],
ok.
erl_prim_loader_is_file(File) ->