Globbing for double extension files

258 Views Asked by At

I have this Gulp snippet:

gulp.src(['./assets/**/*.!(coffee|scss)', '!assets/images{,/**}'])
    .pipe(gulp.dest('.tmp/public'))

And this folder structure:

  • assets
    • js
      • A.coffee
      • A.B.coffee
      • A.B.C.coffee
      • X.js

The intention is to copy everything except:

  • the contents of assets/images
  • any and all CoffeeScript files

However, this glob pattern does not exclude A.B and A.B.C.coffee.

What is the correct pattern to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

You are close. Try this

gulp.src(['./assets/**/!(*.coffee|*.scss)', '!assets/images'])
    .pipe(gulp.dest('.tmp/public'))