mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Make sure to reset CWD after processing subdirs; also filter out missing dirs when restoring code path
This commit is contained in:
parent
a46be8cec1
commit
02fa5f6f42
1 changed files with 8 additions and 1 deletions
|
@ -162,8 +162,13 @@ process_dir(Dir, ParentConfig, Commands) ->
|
||||||
%% are any other dirs that might need processing first.
|
%% are any other dirs that might need processing first.
|
||||||
{UpdatedConfig, Dirs} = acc_modules(select_modules(Modules, preprocess, []),
|
{UpdatedConfig, Dirs} = acc_modules(select_modules(Modules, preprocess, []),
|
||||||
preprocess, Config, ModuleSetFile, []),
|
preprocess, Config, ModuleSetFile, []),
|
||||||
|
?DEBUG("~s subdirs: ~p\n", [Dir, Dirs]),
|
||||||
[process_dir(D, UpdatedConfig, Commands) || D <- Dirs],
|
[process_dir(D, UpdatedConfig, Commands) || D <- Dirs],
|
||||||
|
|
||||||
|
%% Make sure the CWD is reset properly; processing subdirs may have caused it
|
||||||
|
%% to change
|
||||||
|
ok = file:set_cwd(Dir),
|
||||||
|
|
||||||
%% Finally, process the current working directory
|
%% Finally, process the current working directory
|
||||||
apply_commands(Commands, Modules, UpdatedConfig, ModuleSetFile),
|
apply_commands(Commands, Modules, UpdatedConfig, ModuleSetFile),
|
||||||
|
|
||||||
|
@ -239,7 +244,9 @@ update_code_path(Config) ->
|
||||||
restore_code_path(no_change) ->
|
restore_code_path(no_change) ->
|
||||||
ok;
|
ok;
|
||||||
restore_code_path({old, Path}) ->
|
restore_code_path({old, Path}) ->
|
||||||
true = code:set_path(Path),
|
%% Verify that all of the paths still exist -- some dynamically add paths
|
||||||
|
%% can get blown away during clean.
|
||||||
|
true = code:set_path(lists:filter(fun filelib:is_file/1, Path)),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue