Skip to content

Commit

Permalink
Merge pull request #27 from romanenko/prune
Browse files Browse the repository at this point in the history
Prune option for 'update' task
  • Loading branch information
rharriso committed Aug 19, 2013
2 parents 92737a8 + 814e54b commit 7196619
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ The bower.json file is two seperate bower [component.js](https://github.com/twit

``` bash
rake bower:install #install js components
rake bower:update #update js components
rake bower:install:force #install with force option
rake bower:update #update js components
rake bower:update:prune #update components and uninstall extraneous packages
```


Expand Down Expand Up @@ -105,7 +107,9 @@ NOTE: All the assets should be stored in `/assets` subdirectory so putting it un

``` bash
rake bower:dsl:install #install js components
rake bower:dsl:update #update js components
rake bower:dsl:install:force #install with force option
rake bower:dsl:update #update js components
rake bower:dsl:update:prune #update components and uninstall extraneous packages
```


Expand Down
39 changes: 35 additions & 4 deletions lib/tasks/bower.rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require 'json'
require 'pp'

namespace :bower do

desc "install files from bower"
desc "install components from bower"
task :install do
#install to corresponding directories
perform_command do
Expand All @@ -11,38 +12,68 @@ namespace :bower do
end

namespace :install do
desc "install components with -F option"
task :force do
perform_command do
sh 'bower install -F'
end
end
end

desc "update bower packages"
desc "update bower components"
task :update do
#install to corresponding directories
perform_command false do
sh 'bower update'
end
end

namespace :update do
desc "update existing components and uninstalls extraneous components"
task :prune do
perform_command false do
sh 'bower update && bower prune'
end
end
end

namespace :dsl do
desc "install files from bower"
desc "install components from bower"
task :install do
#install to corresponding directories
dsl_perform_command do
sh 'bower install'
end
end

desc "update bower packages"
namespace :install do
desc "install components with -F option"
task :force do
dsl_perform_command do
sh 'bower install -F'
end
end
end

desc "update bower components"
task :update do
#install to corresponding directories
dsl_perform_command false do
sh 'bower update'
end
end

namespace :update do
desc "update existing components and uninstalls extraneous components"
task :prune do
dsl_perform_command false do
sh 'bower update && bower prune'
end
end
end

end

end

def get_bower_root_path
Expand Down

0 comments on commit 7196619

Please sign in to comment.