瀏覽代碼

prevent rebar3 from reloading it's own path and terminating itself

prevents code reloading by temporary marking of rebar3's ebin dir
as sticky during code refresh
pull/901/head
alisdair sullivan 9 年之前
父節點
當前提交
31cc213b81
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      src/rebar_utils.erl

+ 7
- 1
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).

Loading…
取消
儲存