lib/bivouac/tasks/plugins.rake in bivouac-0.3.0 vs lib/bivouac/tasks/plugins.rake in bivouac-0.4.0

- old
+ new

@@ -1,11 +1,27 @@ +require 'bivouac/commands/plugin' + namespace :plugin do desc "List installed plugins" task :list do Dir.glob( BIVOUAC_ROOT + '/plugins/**' ).each do |p| pn = p.gsub( /.*\//, "" ) - print " - #{pn} : " + puts "#{pn} : " Rake::Task["plugin:#{pn}:desc"].invoke + puts + end + end + + desc "Update installed plugins" + task :update do + Dir.glob( BIVOUAC_ROOT + '/plugins/**' ).each do |p| + pn = p.gsub( /.*\//, "" ) + puts "** Update plugin #{pn}" + Bivouac::Plugin.new( ['install', pn] ).run( ) + begin + Rake::Task["plugin:#{pn}:install"].invoke + rescue + end end end Dir.glob( BIVOUAC_ROOT + '/plugins/**/tasks/**.rake' ).each { |p| load p } end