ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

no way to remove directory with contents #71

Open alanning opened 10 years ago

alanning commented 10 years ago

In previous releases (such as 1.3.9) it was possible to delete directories that were not empty.

In 1.5 the default changed but in 1.5.4 there is no way to override and have the deletion complete.

There is a failSilent flag but this comment indicates that at one time there was also a forceDelete override.

/*  wrench.rmdirSyncRecursive("directory_path", forceDelete, failSilent);
 *
 *  Recursively dives through directories and obliterates everything about it. This is a
 *  Sync-function, which blocks things until it's done. No idea why anybody would want an
 *  Asynchronous version. :\
 */
exports.rmdirSyncRecursive = function(path, failSilent) {

forceDelete is a very useful feature and its available for copy so I'm guessing this was an unintended change, possibly due to the recent merge conflicts.

Also, please consider using git tags to track releases so previous versions are more easily viewable.

ryanmcgrath commented 10 years ago

You're correct, this should be available. I'm unable to directly handle this at the moment, but anyone who submits pull requests I'm happy to pipeline up provided there's a test accompanying it.