0

I'm trying to copy everything in my css directory, including any nested folders and files in those folders.

copy: {
        main: {
            options: {
                expand: true
            },
            files: [
                { src: 'public/static/css/**', dest: '../../../'}
            ]
        }
    }

The above works but it appears to be keeping the directory structure.

So in my root where the files are copied to I have:

>public>static>css>styles.css
>public static>css>nested-folder>styles.css

But I would just like to have:

styles.css

>nested-folder>styles.css

Is this possible?

panthro
  • 22,779
  • 66
  • 183
  • 324

1 Answers1

0

Set the current working directory, cwd, in the options. There are some instructions in the Grunt docs and your copy options would look something like:

copy: {
        main: {
            options: {
                expand: true,
                cwd: 'public/static/css',
                src : [ '**' ],
                dest: '../../../'
            }
        }
    }
Matthew Bakaitis
  • 11,600
  • 7
  • 43
  • 53