Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Add deleted files and directories in callback #160

Closed
lucas-viewup opened this issue Sep 15, 2017 · 3 comments
Closed

Comments

@lucas-viewup
Copy link

lucas-viewup commented Sep 15, 2017

Hi there! That would be useful had the feedback of deleted files and directories, here's the deal:

rimraf( '**/.git', {glob: true}, function(err, files){
  
  if(err){
   throw new Error(err);
  }

  console.log( 'Deleted files:');

  files.map(function(file){
    console.log(file);
  });

});

A good reference is glob.

Regards and thanks!

@zkochan
Copy link

zkochan commented Nov 19, 2018

I would love this feature as well. Or at least I would love to know when there was nothing to remove.

Seems like at the moment del does this. And it uses rimraf under the hood

@isaacs
Copy link
Owner

isaacs commented Jan 13, 2023

Patch welcome.

@isaacs
Copy link
Owner

isaacs commented Mar 4, 2023

This will be possible in v4.3.0 by providing a filter option. You can just return true in the filter to delete everything, and if you want to collect it up into an array or something, that's up to you.

@isaacs isaacs closed this as completed in ed3288e Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants