gulp-bower
Advanced tools
Comparing version 0.0.6 to 0.0.7
23
index.js
@@ -8,4 +8,6 @@ var bower = require('bower'); | ||
module.exports = function (opts) { | ||
var toString = {}.toString; | ||
module.exports = function (opts, cmdArguments) { | ||
var stream = through.obj(function(file, enc, callback) { | ||
@@ -16,3 +18,3 @@ this.push(file); | ||
if (typeof opts === 'string') { | ||
if (toString.call(opts) === '[object String]') { | ||
opts = { | ||
@@ -38,3 +40,18 @@ directory: opts | ||
bower.commands.install([], {}, opts) | ||
var cmd = opts.cmd; | ||
if (!cmd) { | ||
cmd = 'install'; | ||
} | ||
delete(opts.cmd); | ||
if (toString.call(cmdArguments) !== '[object Array]') { | ||
cmdArguments = []; | ||
} | ||
if (toString.call(cmdArguments[0]) !== '[object Array]') { | ||
cmdArguments[0] = []; | ||
} | ||
cmdArguments[1] = cmdArguments[1] || {}; | ||
cmdArguments[2] = opts; | ||
bower.commands[cmd].apply(bower.commands, cmdArguments) | ||
.on('log', function(result) { | ||
@@ -41,0 +58,0 @@ gutil.log(['bower', gutil.colors.cyan(result.id), result.message].join(' ')); |
{ | ||
"name": "gulp-bower", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Install Bower packages.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,3 @@ # gulp-bower | ||
```javascript | ||
var gulp = require('gulp'); | ||
var bower = require('gulp-bower'); | ||
@@ -31,2 +32,3 @@ | ||
```javascript | ||
var gulp = require('gulp'); | ||
var bower = require('gulp-bower'); | ||
@@ -43,2 +45,3 @@ | ||
```javascript | ||
var gulp = require('gulp'); | ||
var bower = require('gulp-bower'); | ||
@@ -52,4 +55,20 @@ | ||
By default `gulp-bower` runs `install` command for Bower. | ||
Using `cmd` property, you can specify the custom command. (e.g. `update`) | ||
```javascript | ||
var bower = require('gulp-bower'); | ||
gulp.task('bower', function() { | ||
return bower({ cmd: 'update'}); | ||
}); | ||
``` | ||
## Changelog | ||
#####0.0.7 | ||
- Added commands support (by Keksinautin) | ||
#####0.0.6 | ||
@@ -56,0 +75,0 @@ - Added ability to pass in an initialization object that allows a cwd to be specified (by cb1kenobi) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6326
88
87