Sha256: 3b2c4179117c77b47a9a5e88d2af42e720f87b79159284867a471ee27a3f06db

Contents?: true

Size: 865 Bytes

Versions: 8

Compression:

Stored size: 865 Bytes

Contents

#!/usr/bin/env sh

# This hook has a focus on portability.
# This hook will attempt to setup your environment before running checks.
#
# If you would like `pre-commit` to get out of your way and you are comfortable
# setting up your own environment, you can install the manual hook using:
#
#     pre-commit install --manual
#

cmd=`git config pre-commit.ruby 2>/dev/null`
if   test -n "${cmd}"
then true
elif which rvm   >/dev/null 2>/dev/null
then cmd="rvm default do ruby"
elif which rbenv >/dev/null 2>/dev/null
then cmd="rbenv exec ruby"
else cmd="ruby"
fi

export rvm_silence_path_mismatch_check_flag=1

${cmd} -rrubygems -e '
  begin
    require "pre-commit"
    true
  rescue LoadError => e
    $stderr.puts <<-MESSAGE
pre-commit: WARNING: Skipping checks because: #{e}
pre-commit: Did you set your Ruby version?
MESSAGE
    false
  end and PreCommit.run
'

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
pre-commit-0.23.0 templates/hooks/default
pre-commit-0.23.0 templates/hooks/automatic
pre-commit-0.22.1 templates/hooks/automatic
pre-commit-0.22.1 templates/hooks/default
pre-commit-0.22.0 templates/hooks/automatic
pre-commit-0.22.0 templates/hooks/default
pre-commit-0.21.0 templates/hooks/default
pre-commit-0.21.0 templates/hooks/automatic