From cabaea5ac3aac4e7bc5b83d66a85eb5a09de45cd Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 20 Apr 2012 11:34:05 -0400 Subject: [PATCH] update post-commit, fixed the git issue --- script/gemfile | 1 - script/hooks/commit-msg | 1 + script/hooks/pre-commit | 2 +- script/initialize-environment | 2 +- template/script/hooks/commit-msg | 2 +- template/script/hooks/post-commit | 1 + 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/script/gemfile b/script/gemfile index a4aec05..eb78755 100755 --- a/script/gemfile +++ b/script/gemfile @@ -4,7 +4,6 @@ require 'rubygems' require 'penchant' if Penchant::Gemfile.do_full_env_switch!(ARGV[0]) - system %{bundle} puts "Gemfile switched to #{ARGV[0]}" else exit 0 diff --git a/script/hooks/commit-msg b/script/hooks/commit-msg index 439cffd..786f49a 100755 --- a/script/hooks/commit-msg +++ b/script/hooks/commit-msg @@ -21,3 +21,4 @@ if [ "$(penchant gemfile-env)" != "remote deployment" ]; then git add Gemfile* fi +exit 0 diff --git a/script/hooks/pre-commit b/script/hooks/pre-commit index 9ca0347..8cfef3d 100755 --- a/script/hooks/pre-commit +++ b/script/hooks/pre-commit @@ -1,4 +1,4 @@ #!/bin/bash -# this is now handled in commit-msg, to allow for skipping of test running based on the commit message +# this has been moved to commit-msg diff --git a/script/initialize-environment b/script/initialize-environment index 222c8f1..dad92b2 100755 --- a/script/initialize-environment +++ b/script/initialize-environment @@ -5,7 +5,7 @@ if File.file?('Gemfile.erb') Dir.chdir '..' do 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}" system %{git clone #{repo}} diff --git a/template/script/hooks/commit-msg b/template/script/hooks/commit-msg index 8382873..786f49a 100755 --- a/template/script/hooks/commit-msg +++ b/template/script/hooks/commit-msg @@ -21,4 +21,4 @@ if [ "$(penchant gemfile-env)" != "remote deployment" ]; then git add Gemfile* fi - +exit 0 diff --git a/template/script/hooks/post-commit b/template/script/hooks/post-commit index 490f85d..99e8287 100755 --- a/template/script/hooks/post-commit +++ b/template/script/hooks/post-commit @@ -1,4 +1,5 @@ #!/bin/bash +unset GIT_DIR penchant gemfile remote --switch-back