make hooks a little smarter and forgiving

This commit is contained in:
John Bintz 2012-08-27 09:40:41 -04:00
parent 5cdbdd4ffc
commit d5403f1139
3 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,3 @@
module Penchant
VERSION = "0.2.19"
VERSION = "0.2.20"
end

View File

@ -29,8 +29,12 @@ if [[ "${msg}" != *"[ci skip]"* ]]; then
GIT_DIR=$OLD_GIT_DIR
fi
if [ $(bundle exec rake -P | grep default | wc -l) -ne 0 ]; then
bundle exec rake
R=$?
if [ $R -ne 0 ]; then exit $R; fi
else
echo "[penchant] No default Rake task found! Add one if you want to run tests before committing."
fi
fi

View File

@ -1,6 +1,6 @@
#!/bin/bash
if [ $(bundle exec rake -T preflight_check | wc -l) -eq 1 ]; then
if [ $(bundle exec rake -P | grep preflight_check | wc -l) -ne 0 ]; then
bundle exec rake preflight_check
R=$?
if [ $R -ne 0 ]; then exit $R; fi
@ -11,3 +11,4 @@ penchant gemfile remote --deployment
GIT_DIR=$OLD_GIT_DIR
git add Gemfile*
exit 0