0

I'm trying to copy the content of a folder except one subfolder with grunt.js.

src/
src/folder1
src/folder2
src/folder3

How do I copy the content of src except folder3 in dist/?

dist/
dist/folder1
dist/folder2

I'v tryed things with ! but everythings failled :(.

copy: {
  main: {
    expand: true,
    cwd: 'src/',
    src: [
    '**',
    '!folder3'
    ],
    dest: 'dist/'
  }
}
alienlebarge
  • 3,008
  • 5
  • 24
  • 26
  • 1
    perhaps '!/folder3**'. maybe [this](http://stackoverflow.com/questions/11064773/how-to-match-every-file-but-one-in-grunt-concat) or [this](http://stackoverflow.com/questions/12632029/grunt-minimatch-glob-folder-exclusion) helps – zishe Oct 11 '13 at 12:37

1 Answers1

1

Here is how I managed to do the job:

copy: {
   main: {
     expand: true,
     cwd: 'src/',
     src: [
     '**',
     '!**folder3/**'
     ],
     dest: 'dist/'
   }
 }
alienlebarge
  • 3,008
  • 5
  • 24
  • 26