2011-07-14 19:50:51 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
2011-07-14 19:54:10 +00:00
|
|
|
if File.file?('Gemfile.erb')
|
|
|
|
pwd = Dir.pwd
|
2011-07-14 19:50:51 +00:00
|
|
|
|
2011-07-14 19:54:10 +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
|
|
|
|
2011-07-14 19:54:10 +00:00
|
|
|
puts "Installing #{repo}"
|
|
|
|
system %{git clone #{repo}}
|
|
|
|
end
|
2011-07-14 19:50:51 +00:00
|
|
|
end
|
|
|
|
|
2011-07-14 19:54:10 +00:00
|
|
|
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}
|
|
|
|
|
|
|
|
puts "Done!"
|
|
|
|
|