Negating a pattern is not working
See original GitHub issue.
├── 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!
Issue Analytics
- State:
- Created 9 years ago
- Comments:27 (4 by maintainers)
Top Results From Across the Web
Negating a pattern in gitignore isn't working - Stack Overflow
I tried the commented patterns in a .gitignore file in the directory immediately above the files I want to unignore, but had the...
Read more >Negation not working when pattern begins with ! #62 - GitHub
Beginning a pattern with ! seems to be broken. The result actually matches the non-negated pattern... so for example: glob('!package.json', ...
Read more >Lookahead and Lookbehind Zero-Length Assertions
Negative lookahead is indispensable if you want to match something not followed by something else. When explaining character classes, this tutorial explained ...
Read more >Python tip 12: negate a regex grouping - learnbyexample
)* matches a character only if the current and next two characters are not par . The * quantifier is applied on the...
Read more >Performing pattern negation to multiple nodes - Neo4j
A common incorrect approach does not use collections, but assumes (wrongly) that the pattern negated treats the variable values as a collection. Cypher....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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/.gitdirectory I need to preserve when runninggulp clean:dist…how can I do that?I’ve tried all the suggestions, they don’t work.