From d5202c61930bf18dfb5a7b3df7d638508cdef0c9 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 14 Jul 2011 15:54:10 -0400 Subject: [PATCH] update initialize script for projects that don't use gemfile.erb --- template/script/initialize-environment | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/template/script/initialize-environment b/template/script/initialize-environment index ed32339..5b6d1ae 100755 --- a/template/script/initialize-environment +++ b/template/script/initialize-environment @@ -1,18 +1,23 @@ #!/usr/bin/env ruby -pwd = Dir.pwd +if File.file?('Gemfile.erb') + pwd = Dir.pwd -Dir.chdir '..' do - File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line| - repo = line[%r{:git => (['"])(.*)\1}, 2] + Dir.chdir '..' do + File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line| + repo = line[%r{:git => (['"])(.*)\1}, 2] - puts "Installing #{repo}" - system %{git clone #{repo}} + puts "Installing #{repo}" + system %{git clone #{repo}} + end end -end -puts "Bundling for local environment" -system %{script/gemfile local} + puts "Bundling for local environment" + system %{script/gemfile local} +else + puts "Bundling..." + system %{bundle} +end puts "Installing git hooks" system %{script/install-git-hooks}