diff options
Diffstat (limited to 'src/rebar_prv_common_test.erl')
-rw-r--r-- | src/rebar_prv_common_test.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 9128064..6bf0533 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -347,17 +347,15 @@ reduce_path(Acc, [Component|Rest]) -> reduce_path([Component|Acc], Rest). remove_links(Path) -> - IsDir = ec_file:is_dir(Path), + IsDir = ec_file:is_dir(Path), case ec_file:is_symlink(Path) of true when IsDir -> delete_dir_link(Path); - true -> - file:delete(Path); - false -> - IsDir andalso + false when IsDir -> lists:foreach(fun(ChildPath) -> remove_links(ChildPath) - end, sub_dirs(Path)) + end, dir_entries(Path)); + _ -> file:delete(Path) end. delete_dir_link(Path) -> @@ -366,7 +364,7 @@ delete_dir_link(Path) -> {win32, _} -> file:del_dir(Path) end. -sub_dirs(Path) -> +dir_entries(Path) -> {ok, SubDirs} = file:list_dir(Path), [filename:join(Path, SubDir) || SubDir <- SubDirs]. |