update initialize script for projects that don't use gemfile.erb
This commit is contained in:
parent
b0cd8bc42b
commit
d5202c6193
|
@ -1,18 +1,23 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
pwd = Dir.pwd
|
if File.file?('Gemfile.erb')
|
||||||
|
pwd = Dir.pwd
|
||||||
|
|
||||||
Dir.chdir '..' do
|
Dir.chdir '..' do
|
||||||
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
|
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
|
||||||
repo = line[%r{:git => (['"])(.*)\1}, 2]
|
repo = line[%r{:git => (['"])(.*)\1}, 2]
|
||||||
|
|
||||||
puts "Installing #{repo}"
|
puts "Installing #{repo}"
|
||||||
system %{git clone #{repo}}
|
system %{git clone #{repo}}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
puts "Bundling for local environment"
|
puts "Bundling for local environment"
|
||||||
system %{script/gemfile local}
|
system %{script/gemfile local}
|
||||||
|
else
|
||||||
|
puts "Bundling..."
|
||||||
|
system %{bundle}
|
||||||
|
end
|
||||||
|
|
||||||
puts "Installing git hooks"
|
puts "Installing git hooks"
|
||||||
system %{script/install-git-hooks}
|
system %{script/install-git-hooks}
|
||||||
|
|
Loading…
Reference in New Issue