From b5e0d6d5db19fef0b17e585354f75f57267df142 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Thu, 9 Aug 2012 16:15:10 +0200 Subject: [PATCH] Fix rebar_core:restore_code_path (Reported-by: Siri Hansen) Use erl_prim_loader:read_file_info instead of filelib:is_file to make sure paths inside the escript archive are handled properly. --- src/rebar_core.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rebar_core.erl b/src/rebar_core.erl index a150ef2..9e3f9f0 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -372,9 +372,11 @@ restore_code_path(no_change) -> restore_code_path({old, Path}) -> %% 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, filelib:is_file(F)]), + true = code:set_path([F || F <- Path, erl_prim_loader_is_file(F)]), ok. +erl_prim_loader_is_file(File) -> + erl_prim_loader:read_file_info(File) =/= error. expand_lib_dirs([], _Root, Acc) -> Acc;