mikeobrien / grunt-robocopy

Grunt task for running robocopy.
MIT License
2 stars 5 forks source link

Multiple tasks #1

Open geographika opened 10 years ago

geographika commented 10 years ago

Thanks for a very useful plugin when developing on Windows.

I'm wondering if it is possible to have multiple tasks in a GruntFile.js?

Most other Grunt plugins allow several tasks to be defined, but robocopy only has a single options object. Defining more options means only the last one is run. Defining objects other than options leads to an error when running.

        robocopy: {
            options: {
                source: 'dist',
                destination: '//server/wwwroot/app',
                files: ['*.*'],
                copy: {
                    mirror: true
                },
                file: {
                    excludeFiles: ['*.log']
                }
            }
        },
            options: { // ignores first task, and other names cause an error
                source: 'dist',
                destination: '//server2/wwwroot/app',
                files: ['*.*'],
                copy: {
                    mirror: true
                },
                file: {
                    excludeFiles: ['*.log']
                }
            }
        }
mikeobrien commented 10 years ago

Yeah, its totally possible by registering it as a multitask but unfortunately I didn't do that. :( I'm pretty slammed right now so I probably won't get around to modding it in the short term but will do it at some point. If you have time to change it and test I can of course accept a PR.