summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-10-31 14:14:08 -0500
committerTristan Sloughter <t@crashfast.com>2015-10-31 14:14:08 -0500
commit9bbab2781995546d76b841adabc00270ef45906a (patch)
treec386337cf7c645eafbac79fcbe76df6fcb8f3a63 /src
parent591b018258ca321b9a67e1b44dc4bfd9104ae5ac (diff)
parent31cc213b813c7d7ed7bc1df072fa5b733975d5e1 (diff)
Merge pull request #901 from talentdeficit/prevent_purge_termination
prevent rebar3 from reloading it's own path and terminating itself
Diffstat (limited to 'src')
-rw-r--r--src/rebar_utils.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 4fd4bd1..d00a46f 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -654,13 +654,19 @@ update_code(Paths) ->
code:add_patha(Path),
ok;
{ok, Modules} ->
+ %% stick rebar ebin dir before purging to prevent
+ %% inadvertent termination
+ RebarBin = code:lib_dir(rebar, ebin),
+ ok = code:stick_dir(RebarBin),
%% replace_path causes problems when running
%% tests in projects like erlware_commons that rebar3
%% also includes
%code:replace_path(App, Path),
code:del_path(App),
code:add_patha(Path),
- [begin code:purge(M), code:delete(M) end || M <- Modules]
+ [begin code:purge(M), code:delete(M) end || M <- Modules],
+ %% unstick rebar dir
+ ok = code:unstick_dir(RebarBin)
end
end, Paths).