Skip to content

Instantly share code, notes, and snippets.

@beaufour
Created April 2, 2013 13:40
Show Gist options
  • Save beaufour/5292277 to your computer and use it in GitHub Desktop.
Save beaufour/5292277 to your computer and use it in GitHub Desktop.
A git commit hook runner, for running multiple commit scripts
#!/bin/bash
#
# Collection of pre-commit hooks
#
set -e
# Get directory of script file
ME=$0
if [ -h ${ME} ]; then
# dereference if it is a symlink (hint: OS X does not support readlink -f)
ME=`readlink $0`
fi
# Ideally this should happen, but it makes files look changed in
# Emacs, which is super annoying.
#
# git stash -q --keep-index
# trap "git stash pop -q" EXIT
BINDIR=$(dirname ${ME})
# Run checks
${BINDIR}/string_check.py $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment