-
Notifications
You must be signed in to change notification settings - Fork 21
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
error thrown when trying to delete a file that is gone. #26
Comments
note, was using 'build/**/*' as the match pattern. switching to just 'build' solves the immediate problem. |
I have a related problem -- I'm using Gulp 4, I'm trying to call delete on a directory that may or may not be present, and I'm getting:
The Is there some way I can ignore the error message, or prevent it from happening? I tried on('error'), but that doesn't seem to get fired. |
It's been a while since I have touched this, but as quite a few are clearly still using gulp-clean, I'll try to be more active.
@bcowgill I created a similar case as yours:
I can confirm that filepaths gulp-clean receives are the ones you mentioned:
But in my case the cleaning works and gulp-clean does not emit errors: $ node -v
v9.3.0
$ gulp -v
[21:29:52] CLI version 2.0.0
[21:29:52] Local version 4.0.0
$ gulp clean
[21:29:56] Using gulpfile ~/gulpfile.js
[21:29:56] Starting 'clean'...
[21:29:56] Finished 'clean' after 45 ms Why it actually works, is because of @bcowgill can you provide a reproducible example of your problem? Thanks. @nullbio I am not sure your case actually relates to gulp-clean as gulp-clean does not try to find files with a glob. Most likely this happens already before the execution comes to the gulp-clean plugin. But to be sure could you provide more details or a simplified example where your error occurs? Thanks. |
I know that this is kinda old thread, but for those who are facing @nullbio problem with gulp 4: gulp.task("clean", function() {
return gulp.src("./dist", { read: false, allowEmpty: true })
.pipe(gulpClean());
}); |
gulp-clean gets the listing of files to delete:
build/x
build/x/this.js
it seems the deletion of build/x gets rid of everything and when clean tries to delete build/x/this.js it gives an error. WHY? it's already gone! Perhaps clean should sort the list in reverse length order before doing its work or have an option to ignore / warn on files that are missing.
The text was updated successfully, but these errors were encountered: