Permalink
Browse files

Updated pre-commit hook sample

  • Loading branch information...
1 parent b1a8662 commit aeeb9af778112cf09f70f6554284e7bbd1b81284 @tapmodo committed Jan 26, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 build/pre-commit.bash
View
@@ -1,19 +1,24 @@
#!/bin/bash
+JSFILE=js/jquery.Jcrop.js
+CSSFILE=css/jquery.Jcrop.css
+
echo 'Running pre-commit hook'
-if git diff --no-ext-diff --cached --exit-code js/jquery.Jcrop.js > /dev/null
+if git diff --no-ext-diff --cached --exit-code "${JSFILE}" > /dev/null
then
echo 'No changes made to Jcrop javascript'
else
echo 'Building minimized Jcrop javascript file'
bash build/minimize-js.bash
+ git add "${JSFILE}"
fi
-if git diff --no-ext-diff --cached --exit-code css/jquery.Jcrop.css > /dev/null
+if git diff --no-ext-diff --cached --exit-code "${CSSFILE}" > /dev/null
then
echo 'No changes made to Jcrop CSS file'
else
echo 'Building minimized Jcrop CSS file'
bash build/minimize-css.bash
+ git add "${CSSFILE}"
fi

0 comments on commit aeeb9af

Please sign in to comment.