Skip to content

Instantly share code, notes, and snippets.

@oelmekki
Created June 30, 2009 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oelmekki/138074 to your computer and use it in GitHub Desktop.
Save oelmekki/138074 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
HOOK_PATH=$(dirname $(readlink -f "$0"))
tmp="$HOOK_PATH"/../..
APP_PATH=$(readlink -f "$tmp"/.);
commit=0
count=$(ack xdebug $APP_PATH --type=php | wc -l)
if [[ $count != "0" ]]; then
ack xdebug $APP_PATH --type=php
commit=1
fi
count=$(ack console $APP_PATH --type=js | wc -l)
if [[ $count != "0" ]]; then
ack console $APP_PATH --type=js
commit=1
fi
exit $commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment