Skip to content

Instantly share code, notes, and snippets.

@pvcarrera
Last active December 26, 2016 19:35
Show Gist options
  • Save pvcarrera/16b0d1e7c9f3445c2d9d589ee7acb3a3 to your computer and use it in GitHub Desktop.
Save pvcarrera/16b0d1e7c9f3445c2d9d589ee7acb3a3 to your computer and use it in GitHub Desktop.
#!/bin/bash
HOOKS="pre-commit-rspec pre-commit-rubocop"
for hook in $HOOKS; do
if [ -f "$PWD/.git/hooks/$hook" ]; then
"$PWD/.git/hooks/$hook"
if [ $? != 0 ]; then
exit 1
fi
else
echo "Error: file $hook not found."
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment