Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwd bug #270

Open
SerDIDG opened this issue Feb 20, 2016 · 3 comments
Open

cwd bug #270

SerDIDG opened this issue Feb 20, 2016 · 3 comments

Comments

@SerDIDG
Copy link

SerDIDG commented Feb 20, 2016

Hello. When i trying somethings like that, my "prod" folder will stay empty after copying process:

copy: { fonts: { files: [{ expand: true, cwd: 'lib/fonts/', src: ['**/*.*', '!**/*.json'], dest: 'build/fonts/lib/' },{ expand: true, cwd: 'src/fonts/', src: ['**/*.*', '!**/*.json'], dest: 'build/fonts/' },{ expand: true, cwd: 'build/fonts/', src: ['**/*.*'], dest: 'public/fonts/' }] } }

When I remove the cwd parameter the files are copied successfully to the prod folder, but without the relative paths, as expected. Is this is a bug or a feature?

@nofear87
Copy link

nofear87 commented Mar 4, 2016

please show actual and expected file structure thanks!

@SerDIDG
Copy link
Author

SerDIDG commented Mar 4, 2016

I've made sample repository. After running grunt command I expect Folder_D is exactly the same as Folder_C, hovever Folder_D was not created at all. https://github.com/SerDIDG/Grunt-CopyCWDTest

@nofear87
Copy link

nofear87 commented Mar 9, 2016

Try this:

copy: {
            test: {
                files: [{
                    expand: true,
                    cwd: 'Folder_A',
                    src: ['**'],
                    dest: 'Folder_C'
                },
                {
                    expand: true,
                    cwd: 'Folder_B',
                    src: ['**'],
                    dest: 'Folder_C'
                }]
            },
            test2: {
                files: [ {
                    expand: true,
                    cwd: 'Folder_C',
                    src: ['**'],
                    dest: 'Folder_D'
                }]
            }
        }
    });

   grunt.registerTask('default', ['clean', 'copy:test', 'copy:test2']);

Folder_C can't be copied, because the folder did not excist at this time. Thats because I used a second task. Another solution could be a watch or a delay. Hope this helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants