Skip to content

Commit

Permalink
fixes #61
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicradish committed Jan 18, 2014
1 parent 35d4516 commit 7f2acff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Default value: `true`

Whether you want to run bower install task itself (e.g. you might not want to do this each time on CI server).

#### options.prune
Type: `Boolean`
Default value: `true`

Whether you want to run bower prune task itself (e.g. you might not want to do this each time on CI server).

#### options.cleanTargetDir
Type: `Boolean`
Default value: `false`
Expand Down
16 changes: 16 additions & 0 deletions tasks/bower_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ module.exports = function(grunt) {
callback();
}

function prune(options,callback) {
bower.commands.prune([], options.bowerOptions)
.on('log', function(result) {
log(['bower', result.id.cyan, result.message].join(' '));
})
.on('error',fail)
.on('end',callback);
}

function install(options, callback) {
bower.commands.install([], options.bowerOptions)
.on('log', function(result) {
Expand Down Expand Up @@ -62,6 +71,7 @@ module.exports = function(grunt) {
targetDir: './lib',
layout: 'byType',
install: true,
prune: true,
verbose: false,
copy: true,
bowerOptions: {}
Expand Down Expand Up @@ -97,6 +107,12 @@ module.exports = function(grunt) {
});
}

if (options.prune) {
add('Pruned bower packages', function(callback) {
prune(options,callback);
});
}

if (options.copy) {
add('Copied packages to ' + targetDir.grey, function(callback) {
copy(options, callback);
Expand Down

0 comments on commit 7f2acff

Please sign in to comment.