#!/bin/bash
files=$(git diff --cached --name-only --diff-filter=ACM | grep -v "/vendor" | grep ".js$")
set -e
for file in ${files}; do
jshint ${file}
test ! -z "$(diff <(js-beautify ${file}) ${file})" && echo "${file} needs beautification" && exit 1
done
exit 0