While at it, improve the error message printed by rebar_utils:sh/2.
Add flags to rebar_utils:sh to control output and error handling. Replace calls to os:cmd with calls to rebar_utils:sh.
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.