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.
This commit is contained in:
Tuncer Ayaz 2012-08-09 16:15:10 +02:00
parent 16091f9934
commit b5e0d6d5db

View file

@ -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;