chore(bower): write grunt task for running bower

This commit is contained in:
Ken Sheedlo
2013-07-30 15:25:54 -07:00
parent a7ae292e39
commit aa5a16224b
5 changed files with 36 additions and 24 deletions

View File

@@ -1,3 +1,4 @@
var bower = require('bower');
var util = require('./utils.js');
var spawn = require('child_process').spawn;
@@ -63,4 +64,15 @@ module.exports = function(grunt) {
grunt.registerTask('collect-errors', 'Combine stripped error files', function () {
util.collectErrors();
});
grunt.registerTask('bower', 'Install Bower packages.', function () {
var done = this.async();
bower.commands.install()
.on('log', function (result) {
grunt.log.ok('bower: ' + result.id + ' ' + result.data.endpoint.name);
})
.on('error', grunt.fail.warn.bind(grunt.fail))
.on('end', done);
});
};