gruntjsgrunt-contrib-copy

Simple grunt copy task not working


Could someone please help me and tell me what Im doing wrong here. I have the following grunt task where I want to move a css file from the build directory to the root of my project.

module.exports = {
    copy: {
        main: {
            files: [{
                expand: true,
                cwd: "build/css/",
                src: "style.css",
                dest: "../"
            }]
        },
    },
}

When I run grunt copy -v this is what is says:

$ grunt copy -v
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Running tasks: copy

Running "copy" task

Running "copy:copy" (copy) task
Verifying property copy.copy exists in config...OK
File: [no files]
Options: encoding="utf8", processContent=false, processContentExclude=[], timestamp=false, mode=false


Done, without errors.

Solution

  • Don't worry, worked it out. Too late in the evening for this... :(

    The task was running off the file name so removed copy and it now works.

    module.exports = {
        main: {
            files: [{
                expand: true,
                cwd: "build/css/",
                src: "style.css",
                dest: "../"
            }]
        },
    }