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( /.*\//, "" ) 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