del: Negating a pattern is not working
.
├── assets
│ ├── .gitkeep
│ ├── rev-manifest.json
│ ├── style-2ccbb519.css
I’m auto compiling my less and using gulp-rev for revisioning. I have a clean:css task defined like so:
gulp.task('clean:css', function (cb) {
del(['public/assets/**', '!public/assets/.gitkeep'], cb);
});
When running the clean:css task everything in the public/assets
directory is removed including .gitkeep
, I expect .gitkeep
to remain in place. I have replaced .gitkeep
with example.txt
to rule out problems with empty files and the problem persists (example.txt contained “example”).
Have I missed something obvious, if not is there something I can do to debug this? I’m using ubuntu 14.04 (through Vagrant). Gulp is at version 3.8.7, npm is 1.3.10 and del is 0.1.1.
I followed this recipe.
Thank you!
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 27 (4 by maintainers)
Commits related to this issue
- Added test for nested dir negation pattern, see #3 — committed to Ferdaszewski/del by deleted user 9 years ago
I also had a problem with it deleting my dist folder with this code
after changing it to the below, it worked
I have a
./dist/.git
directory I need to preserve when runninggulp clean:dist
…how can I do that?I’ve tried all the suggestions, they don’t work.
I found luck with this, if it helps anyone
Please stop complaining. This is free, open source software and everybody is free to submit a PR with a fix 😃
one thing I realized is that you need to exclude each folder in the path, a well as inside the folders, example:
which would be the same as