delete unused things
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
# JSCS Pre-Commit
|
||||
# If a JavaScript file is trying to be committed and it fails style checking
|
||||
# then fail the commit
|
||||
|
||||
EXIT_CODE=0
|
||||
COLOR_RED="\x1B[31m"
|
||||
COLOR_YELLOW="\x1B[1;33m"
|
||||
COLOR_GREEN="\x1B[32m"
|
||||
COLOR_NONE="\x1B[0m"
|
||||
|
||||
if ! jscs > /dev/null 2>&1; then
|
||||
echo "${COLOR_YELLOW}JSCS is not installed. Exiting.${COLOR_NONE}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
repo=$( git rev-parse --show-toplevel )
|
||||
|
||||
for file in $( exec git diff-index --cached --name-only HEAD ); do
|
||||
if [ ${file: -3} == ".js" ]; then
|
||||
status=$( exec git status --porcelain $file )
|
||||
|
||||
if [[ $status != D* ]]; then
|
||||
jscs ${repo}/${file}
|
||||
EXIT_CODE=$((${EXIT_CODE} + $?))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
if [[ ${EXIT_CODE} -ne 0 ]]; then
|
||||
echo "${COLOR_RED}✘ JSCS detected syntax problems.${COLOR_NONE}"
|
||||
else
|
||||
echo "${COLOR_GREEN}✔ JSCS detected no errors.${COLOR_NONE}"
|
||||
fi
|
||||
|
||||
exit $((${EXIT_CODE}))
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
# JSHint Pre-Commit
|
||||
# If a JavaScript file is trying to be committed and it fails linting
|
||||
# then fail the commit
|
||||
|
||||
EXIT_CODE=0
|
||||
COLOR_RED="\x1B[31m"
|
||||
COLOR_YELLOW="\x1B[1;33m"
|
||||
COLOR_GREEN="\x1B[32m"
|
||||
COLOR_NONE="\x1B[0m"
|
||||
|
||||
if ! jshint > /dev/null 2>&1; then
|
||||
echo "${COLOR_YELLOW}JSHint is not installed. Exiting.${COLOR_NONE}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
repo=$( git rev-parse --show-toplevel )
|
||||
|
||||
for file in $( exec git diff-index --cached --name-only HEAD ); do
|
||||
if [ ${file: -3} == ".js" ]; then
|
||||
status=$( exec git status --porcelain $file )
|
||||
|
||||
if [[ $status != D* ]]; then
|
||||
jshint ${repo}/${file}
|
||||
EXIT_CODE=$((${EXIT_CODE} + $?))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
if [[ ${EXIT_CODE} -ne 0 ]]; then
|
||||
echo "${COLOR_RED}✘ JSHINT detected syntax problems.${COLOR_NONE}"
|
||||
else
|
||||
echo "${COLOR_GREEN}✔ JSHINT detected no errors.${COLOR_NONE}"
|
||||
fi
|
||||
|
||||
exit $((${EXIT_CODE}))
|
||||
Reference in New Issue
Block a user