Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated pre-commit hook sample

  • Loading branch information...
commit aeeb9af778112cf09f70f6554284e7bbd1b81284 1 parent b1a8662
@tapmodo authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 build/pre-commit.bash
View
9 build/pre-commit.bash
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.