Permalink
Browse files

Added example pre-commit script

  • Loading branch information...
1 parent f5e384e commit b3d9a5533d96967a6f3fbacfc72a32ec7adc02e6 @arthurakay committed Dec 20, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 hooks/pre-commit
View
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+clear
+
+### Check for errors; abandon the process if error exist
+function checkError {
+ if [[ $1 != 0 ]] ; then
+ #prevent commit with error code
+ exit 99
+ fi
+}
+
+echo "*** Checking JavaScript for lint... ***"
+
+#run LintRunner
+cd hooks
+node pre-commit.js
+
+checkError $?
+
+
+### Exit successfully
+exit 0

0 comments on commit b3d9a55

Please sign in to comment.