totothegreat
totothegreat

Reputation: 1643

How do i copy entire folder from one place to another with grunt-contrib-copy?

What is the correct way to copy two folders from one place to another:

This is the code i wrote and is not the correct one, what i want is the following:

  copy: {
                main: {
                    files: [
                        // includes files within path
                        {src: ['public/modules/game'], dest: 'footboss-phonegap/www/modules/'},

                        // includes files within path and its sub-directories
                        {src: ['public/modules/core'], dest: 'footboss-phonegap/www/modules/'}

                    ]
                }
            }

i want to copy entire folder name game from public/modules/

and copy it to the currently empty direcory in footboss-phonegap/www/modules/

So in the end this is the structure in the footboss-phonegap/www/modules/

-game (full folder from src)
-core (full folder from src)

Upvotes: 1

Views: 129

Answers (1)

totothegreat
totothegreat

Reputation: 1643

Well, this was the answer i needed: From the cwd to how should src look like when files that i need transfer are not only js, but all of them (html,css,mp3 etc.)

copy: {
            main: {
                files: [
                    // includes files within path
                    {expand:true,cwd:'public/modules/game', src: ['**/*'], dest: 'footboss-phonegap/www/modules/game'},

                    // includes files within path and its sub-directories
                    {expand:true,cwd:'public/modules/core', src: ['**/*'], dest: 'footboss-phonegap/www/modules/core'}

                ]
            }
        }

Upvotes: 1

Related Questions