penchant/template/script/initialize-environment

30 lines
580 B
Plaintext
Raw Normal View History

2011-07-14 19:50:51 +00:00
#!/usr/bin/env ruby
if File.file?('Gemfile.erb')
pwd = Dir.pwd
2011-07-14 19:50:51 +00:00
Dir.chdir '..' do
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
repo = line[%r{:git => (['"])(.*)\1}, 2]
2011-07-14 19:50:51 +00:00
puts "Installing #{repo}"
system %{git clone #{repo}}
end
2011-07-14 19:50:51 +00:00
end
puts "Bundling for local environment"
system %{script/gemfile local}
else
puts "Bundling..."
system %{bundle}
end
2011-07-14 19:50:51 +00:00
puts "Installing git hooks"
system %{script/install-git-hooks}
2011-07-14 21:16:11 +00:00
puts "Trying to run rake bootstrap..."
system %{rake bootstrap}
2011-07-14 19:50:51 +00:00
puts "Done!"