Last active
June 3, 2016 13:21
-
-
Save dmfilipenko/91ef807ce78c46fe86fe673225fa55e9 to your computer and use it in GitHub Desktop.
Revisions
-
Dmitriy Filipenko revised this gist
Jun 3, 2016 . 1 changed file with 14 additions and 26 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,38 +1,26 @@ #!/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" -
Dmitriy Filipenko revised this gist
May 31, 2016 . 1 changed file with 45 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,46 @@ #!/bin/sh STAGED_FILES=$(git diff --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") echo $STAGED_FILES if [[ "$STAGED_FILES" = "" ]]; then exit 0 fi PASS=true echo "\nElsint Javascript:\n" for FILE in $STAGED_FILES do ./node_modules/.bin/eslint $FILE if [[ "$?" == 0 ]]; then echo "\t\033[32mESLint Passed: $FILE\033[0m" else echo "\t\033[41mESLint Failed: $FILE\033[0m" PASS=false fi done echo "\nElsint Javascript:\n" for FILE in $STAGED_FILES do npm run flow if [[ "$?" == 0 ]]; then echo "\t\033[32mFlow Passed\033[0m" else echo "\t\033[41mFlow Failed\033[0m" PASS=false fi done 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 $? -
Dmitriy Filipenko revised this gist
May 27, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ #!/bin/sh SECONDS=0 # do some work echo 'START: Flow check' npm run flow echo 'END: Flow check success' echo 'START: Eslint check' npm run eslint echo 'END: Eslint check success' duration=$SECONDS echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." -
Dmitriy Filipenko revised this gist
May 27, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,11 @@ #!/bin/sh SECONDS=0 # do some work echo 'RUN: Flow check' npm run flow echo 'RUN: Flow check success' echo 'RUN: Eslint check' npm run eslint echo 'RUN: Eslint check success' duration=$SECONDS echo "$(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." -
Dmitriy Filipenko revised this gist
May 27, 2016 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ #!/bin/sh echo 'RUN: Flow check' npm run flow echo 'RUN: Flow check success' echo 'RUN: Eslint check' npm run eslint echo 'RUN: Eslint check success' -
Dmitriy Filipenko created this gist
May 27, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ #!/bin/sh npm run flow