19 lines
563 B
Ruby
19 lines
563 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require 'fileutils'
|
|
require 'yaml'
|
|
|
|
Dir['vendor/plugins/*'].each { |d| FileUtils.rm_rf(d) }
|
|
|
|
plugins = YAML.load_file('config/plugins.yml').yield_self { |ary| ary || [] }.map do |plugin|
|
|
[ %[git clone #{plugin.fetch('git')} vendor/plugins/#{plugin.fetch('name')}],
|
|
%[cd vendor/plugins/#{plugin.fetch('name')} && git checkout #{plugin.fetch('commit')}],
|
|
].each do |command|
|
|
Kernel.system(command)
|
|
Kernel.exit(false) unless $?.success?
|
|
end
|
|
plugin
|
|
end
|
|
|
|
Kernel.puts "\n#{plugins.count} plugin(s) installed to vendor/plugins."
|