Sha256: 4d6be6186e5ebbaf1262577d1a8da18ebc1da2a7720cb449e3a37dbcb79a1591

Contents?: true

Size: 841 Bytes

Versions: 24

Compression:

Stored size: 841 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
then cmd="rvm default do ruby"
elif which rbenv > /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

24 entries across 12 versions & 1 rubygems

Version Path
pre-commit-0.20.0 templates/hooks/default
pre-commit-0.20.0 templates/hooks/automatic
pre-commit-0.19.0 templates/hooks/default
pre-commit-0.19.0 templates/hooks/automatic
pre-commit-0.18.0 templates/hooks/automatic
pre-commit-0.18.0 templates/hooks/default
pre-commit-0.17.0 templates/hooks/default
pre-commit-0.17.0 templates/hooks/automatic
pre-commit-0.16.3 templates/hooks/default
pre-commit-0.16.3 templates/hooks/automatic
pre-commit-0.16.2 templates/hooks/automatic
pre-commit-0.16.2 templates/hooks/default
pre-commit-0.16.1 templates/hooks/default
pre-commit-0.16.1 templates/hooks/automatic
pre-commit-0.16.0 templates/hooks/automatic
pre-commit-0.16.0 templates/hooks/default
pre-commit-0.15.0 templates/hooks/automatic
pre-commit-0.15.0 templates/hooks/default
pre-commit-0.14.1 templates/hooks/default
pre-commit-0.14.1 templates/hooks/automatic