Skip to content

Instantly share code, notes, and snippets.

@dmfilipenko
Last active June 3, 2016 13:21
Show Gist options
  • Save dmfilipenko/91ef807ce78c46fe86fe673225fa55e9 to your computer and use it in GitHub Desktop.
Save dmfilipenko/91ef807ce78c46fe86fe673225fa55e9 to your computer and use it in GitHub Desktop.
#!/bin/sh
PASS=true
echo "\nElsint Javascript:\n"
npm run eslint
if [[ "$?" == 0 ]]; then
echo "\t\033[32mESLint Passed: $FILE\033[0m"
else
echo "\t\033[41mESLint Failed: $FILE\033[0m"
PASS=false
fi
echo "\nElsint Javascript:\n"
npm run flow
if [[ "$?" == 0 ]]; then
echo "\t\033[32mFlow Passed\033[0m"
else
echo "\t\033[41mFlow Failed\033[0m"
PASS=false
fi
echo "\nJavascript validation completed!\n"
if ! $PASS; then
echo "\t\033[41mCOMMIT FAILED:\033[0m\n"
exit 1
else
echo "\t\033[42mCOMMIT SUCCEEDED\033[0m\n"
fi
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment