odbhut.shei.chhele
odbhut.shei.chhele

Reputation: 6234

Cannot automate bower with gulp

I want gulp to run my bower and install all the files in bower.json. But it is not doing that. I am not getting any error also so I am not sure if I am doing anything wrong or not. Here is the code that I have written.

var gulp = require("gulp");
var bower = require("bower");
var util = require("util");

// console.log(util.inspect(bower, false, null));

gulp.task("bower", function(callback){
    bower.commands.install().on("end", function(installed){
        callback();
    });
});
gulp.task("default", ["bower"]);

Thanks in advance.

Upvotes: 0

Views: 121

Answers (1)

Robbie
Robbie

Reputation: 19500

You are requiring the main bower package and using it programatically. With gulp, it would be easier to use the gulp-bower plugin instead - https://github.com/zont/gulp-bower#usage

Upvotes: 1

Related Questions