From 95a450cce222695dbcb791f8ea6236df1b0a26d0 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 20 Apr 2012 11:26:27 -0400 Subject: [PATCH] oops --- template/script/hooks/commit-msg | 24 ++++++++++++++++++++++++ template/script/hooks/pre-commit | 17 +---------------- 2 files changed, 25 insertions(+), 16 deletions(-) create mode 100755 template/script/hooks/commit-msg diff --git a/template/script/hooks/commit-msg b/template/script/hooks/commit-msg new file mode 100755 index 0000000..8382873 --- /dev/null +++ b/template/script/hooks/commit-msg @@ -0,0 +1,24 @@ +#!/bin/bash + +msg=$(cat $1) + +OLD_GIT_DIR=$GIT_DIR + +if [[ "${msg}" != *"[ci skip]"* ]]; then + if [ "$(penchant gemfile-env)" != "remote" ]; then + penchant gemfile remote + fi + + bundle exec rake + R=$? + if [ $R -ne 0 ]; then exit $R; fi +fi + +if [ "$(penchant gemfile-env)" != "remote deployment" ]; then + unset GIT_DIR + penchant gemfile remote --deployment + GIT_DIR=$OLD_GIT_DIR + git add Gemfile* +fi + + diff --git a/template/script/hooks/pre-commit b/template/script/hooks/pre-commit index d5dc180..8cfef3d 100755 --- a/template/script/hooks/pre-commit +++ b/template/script/hooks/pre-commit @@ -1,19 +1,4 @@ #!/bin/bash -OLD_GIT_DIR=$GIT_DIR - -if [ "$(penchant gemfile-env)" != "remote" ]; then - penchant gemfile remote -fi - -bundle exec rake -R=$? -if [ $R -ne 0 ]; then exit $R; fi - -if [ "$(penchant gemfile-env)" != "remote deployment" ]; then - unset GIT_DIR - penchant gemfile remote --deployment - GIT_DIR=$OLD_GIT_DIR - git add Gemfile* -fi +# this has been moved to commit-msg