Last active
March 17, 2017 12:40
-
-
Save janurag/9cc62ae6817ab84e7a9b81e193441f74 to your computer and use it in GitHub Desktop.
Pre commit Testing and Standardization of Javascript code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Description: Written while working in Macbook | |
# color for bash | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
echo "Wait.... I am Testing Your code!" | |
# for Testing | |
pwd && ls | |
# checking eslint status | |
eslintStatus=0 | |
./node_modules/eslint/bin/eslint.js . || eslintStatus=$? | |
if [ $eslintStatus -ne 0 ]; then | |
echo "${RED}ERROR:: PLEASE RESOLVE THE ABOVE ERROR AND THEN COMMIT ${NC}" | |
exit 1 | |
fi | |
# For Testing | |
# echo "eslintStatus: " | |
# echo $eslintStatus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment