Reputation: 33272
I've got a task in gulp, using gulp-hg, as follow:
gulp.task('init',['clean'],function(){
return hg.clone('https://myrepo','./deploy',{args:'--insecure'},function(error,stout){
util.log(error);
});
});
apparently gulp execute another task depending on 'init', before the command finish. Is something wrong in the way I'm using the callback?
Upvotes: 0
Views: 52
Reputation: 77620
You need to follow one of the async task patterns:
In your example, a callback might look like this:
gulp.task('init',['clean'],function(cb){
hg.clone('https://myrepo','./deploy',{args:'--insecure'},function(error,stout){
util.log(error);
cb(error);
});
});
Upvotes: 1