0

I am trying to match an entire folder structure of CSS files with the exception of a certain sub-folder and its included CSS files.

Consider this structure:

styles
    css
        thing1
            include.css
            include2.css
        thing2
            toBeExcluded
                exclude.css
                exclude2.css

In this example, I want to include the files include.css and include2.css but exclude the files inside the thing2 sub-folder.

Here is the pattern I am using gulp.src(["!./styles/css/thing2/", "!./styles/css/thing2/**/*.css", "./styles/css/**/*.css"])

However, try as I might, I don't seem able to negate the thing2 folder and it's files. Any idea what I'm doing wrong?

Ben Frain
  • 2,510
  • 1
  • 29
  • 44
  • can you try putting the negation part at the end, just change the sequence – harishr Aug 10 '15 at 15:50
  • You mean like: `gulp.src(["./styles/css/**/*.css", "!./styles/css/thing2/", "!./styles/css/thing2/**/*.css"])`? If so, I have already tried and same issue :( – Ben Frain Aug 10 '15 at 15:57
  • Using gulp-debug (http://stackoverflow.com/a/21806974/1527470) and the same folder structure as yours: `gulp-debug: styles/css/thing1/include copy.css` `gulp-debug: styles/css/thing1/include.css` `gulp-debug: 2 items` so it looks like your glob is working as expected. – dmnsgn Aug 10 '15 at 17:25
  • thanks @dmnsgn I used debug and found I was still getting the files which confirmed I'd done something idiotic. I'd got a typo in my paths! Now working as expected! – Ben Frain Aug 11 '15 at 08:38

0 Answers0