penchant/script/hooks/commit-msg

28 lines
503 B
Plaintext
Raw Normal View History

2012-04-20 15:12:56 +00:00
#!/bin/bash
msg=$(cat $1)
2012-07-24 14:48:11 +00:00
# wtf mac os x lion
if [ ! -z "$MY_RUBY_HOME" ]; then
PATH="$MY_RUBY_HOME/bin:$PATH"
fi
2012-04-20 15:12:56 +00:00
if [ ! -z "$GEM_PATH" ]; then
oifs="$IFS"
while IFS=":" read -ra GEM_PATHS; do
FIXED_GEM_PATH=""
for i in "${GEM_PATHS[@]}"; do
FIXED_GEM_PATH="$FIXED_GEM_PATH:${i}/bin"
done
done <<< "$GEM_PATH"
IFS="$oifs"
PATH="$FIXED_GEM_PATH:$PATH"
fi
2012-04-20 15:12:56 +00:00
if [[ "${msg}" != *"[ci skip]"* ]]; then
2012-07-24 14:48:11 +00:00
bundle exec rake --trace
2012-04-20 15:12:56 +00:00
R=$?
if [ $R -ne 0 ]; then exit $R; fi
fi