diff options
author | Juhani Rankimies <juhani@juranki.com> | 2010-10-26 07:19:30 +0300 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2010-10-27 11:39:12 -0600 |
commit | fd5ebe69a4d4028908247f6d669eb38254613269 (patch) | |
tree | f963d76d95a46fda14d6d491ecdc14cabcdc06c1 /src/rebar_erlc_compiler.erl | |
parent | 75fc2378bf006b5660ce2115561d36bea10e04c5 (diff) |
Port rebar_file_utils to Windows
Modify rm_rf and cp_r to work when {win32,_} = os:type().
Simplify rm_rf to only accept one filename, directoryname or wildcard.
Add unit tests to ensure a similar behaviour on windows and unix.
Thanks to tuncer for guidance and feedback.
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r-- | src/rebar_erlc_compiler.erl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 50e890c..e872e2b 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -71,10 +71,8 @@ compile(Config, _AppFile) -> -spec clean(Config::#config{}, AppFile::string()) -> 'ok'. clean(_Config, _AppFile) -> - %% TODO: This would be more portable if it used Erlang to traverse - %% the dir structure and delete each file; however it would also - %% much slower. - ok = rebar_file_utils:rm_rf("ebin/*.beam priv/mibs/*.bin"), + lists:foreach(fun(F) -> ok = rebar_file_utils:rm_rf(F) end, + ["ebin/*.beam", "priv/mibs/*.bin"]), YrlFiles = rebar_utils:find_files("src", "^.*\\.[x|y]rl\$"), rebar_file_utils:delete_each( |