Sha256: 1551ee33ef0fa2dd1dd246b22b1caca9020c5406fb920883470b9c6539de1a7a

Contents?: true

Size: 923 Bytes

Versions: 13

Compression:

Stored size: 923 Bytes

Contents

#!/bin/bash

msg=$(cat $1)

OLD_GIT_DIR=$GIT_DIR

# lion appears to insert git paths before everything else. ensure rvm can
# bust through, at the very least.
if [ ! -z "$MY_RUBY_HOME" ]; then
  PATH="$MY_RUBY_HOME/bin:$PATH"
fi

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

if [[ "${msg}" != *"[ci skip]"* ]]; then
  if [ "$(penchant gemfile-env)" != "remote" ]; then
    unset GIT_DIR
    penchant gemfile remote
    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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
penchant-0.2.29 template/script/hooks/commit-msg
penchant-0.2.28 template/script/hooks/commit-msg
penchant-0.2.27 template/script/hooks/commit-msg
penchant-0.2.26 template/script/hooks/commit-msg
penchant-0.2.24 template/script/hooks/commit-msg
bullseye-0.0.8 script/hooks/commit-msg
bullseye-0.0.7 script/hooks/commit-msg
penchant-0.2.23 template/script/hooks/commit-msg
penchant-0.2.22 template/script/hooks/commit-msg
bullseye-0.0.4 script/hooks/commit-msg
penchant-0.2.21 template/script/hooks/commit-msg
bullseye-0.0.3 script/hooks/commit-msg
penchant-0.2.20 template/script/hooks/commit-msg