kaminaly / gulp-sync

28 stars 6 forks source link

Pass parameters into tasks #6

Closed doronsever closed 9 years ago

doronsever commented 9 years ago

Is there a way to pass params into the task? For instance

gulp.task('default', gulpsync.sync(['a --platform desktop', 'b', 'c']))

kaminaly commented 9 years ago

It can't pass params into the task. But if you prepare tasks of all necessary types, you can use it as a simple conditional.

For example

gulp.task('a:desktop', function(){
    // for desktop
});
gulp.task('a:mobile', function(){
    // for mobile
});

gulp.task('default', gulpsync.sync(['a:desktop', 'b', 'c']));
doronsever commented 9 years ago

Well, i figured it out that when you run gulp [taskname] --env dektop the env parameter will pass through to all subtasks. 10x alot though!

kaminaly commented 9 years ago

oh, It's very simple solve!