zont / gulp-bower

MIT License
82 stars 22 forks source link

Implement callback for async task execution #40

Closed trickford closed 9 years ago

trickford commented 9 years ago

Implement callback support so that other tasks can be dependent on gulp-bower completing (per the documentation here).

Example usage:

var gulp = require('gulp');

// takes in a callback so the engine knows when it'll be done
gulp.task('one', function(cb) {
    // do stuff -- async or otherwise
    cb(err); // if err is not null and not undefined, the run will stop, and note that it failed
});

// identifies a dependent task must be complete before this one begins
gulp.task('two', ['one'], function() {
    // task 'one' is done now
});

gulp.task('default', ['one', 'two']);
thasmo commented 9 years ago

That's absolutely needed. Please implement it!

zont commented 9 years ago

It works:

var gulp = require('gulp');
var bower = require('gulp-bower');

gulp.task('bower', function() {
  return bower();
});

gulp.task('two', ['bower'],  function() {
  // task 'one' is done now
});
thasmo commented 9 years ago

Indeed, works already. Thanks!