Created
November 1, 2021 12:22
-
-
Save nwoow/cf90a089beaf21fa5247e5e2bf99745c to your computer and use it in GitHub Desktop.
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 characters
| #!/bin/sh | |
| . "$(dirname "$0")/_/husky.sh" | |
| echo '๐๏ธ๐ท Styling, testing and building your project before committing' | |
| # Running prettier format and eslint fix | |
| yarn format || | |
| ( | |
| echo '๐คข๐คฎ๐คข๐คฎ Yarn format Failed. ๐คข๐คฎ๐คข๐คฎ | |
| Please check the console for erros, resolve them and try again'; | |
| false; | |
| ) | |
| # # Check Prettier standards | |
| # yarn check:format || | |
| # ( | |
| # echo '๐คข๐คฎ๐คข๐คฎ Its F**KING RAW - Your styling looks disgusting. ๐คข๐คฎ๐คข๐คฎ | |
| # Prettier Check Failed. Run "yarn format", add changes and try commit again.'; | |
| # false; | |
| # ) | |
| # # Check ESLint Standards | |
| # yarn check:lint || | |
| # ( | |
| # echo '๐ค๐๐๐ค Get that weak s**t out of here! ๐ค๐๐๐ค | |
| # ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.' | |
| # false; | |
| # ) | |
| # # Check tsconfig standards | |
| # yarn check-types || | |
| # ( | |
| # echo '๐คก๐โ๐คก Failed Type check. ๐คก๐โ๐คก | |
| # Are you seriously trying to write that? Make the changes required above.' | |
| # false; | |
| # ) | |
| # # If everything passes... Now we can commit | |
| # echo '๐ค๐ค๐ค๐ค... Alright... Code looks good to me... Trying to build now. ๐ค๐ค๐ค๐ค' | |
| # yarn build || | |
| # ( | |
| # echo 'โ๐ท๐จโ Better call Bob... Because your build failed โ๐ท๐จโ | |
| # Next build failed: View the errors above to see why. | |
| # ' | |
| # false; | |
| ) | |
| # If everything passes... Now we can commit | |
| git add . | |
| echo 'โ โ โ โ You win this time... I am committing this now. โ โ โ โ ' |
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 characters
| #!/bin/sh | |
| . "$(dirname "$0")/_/husky.sh" | |
| echo '๐๏ธ๐ท Running yarn build' | |
| npm run build || | |
| ( | |
| echo 'โ๐ท๐จโ Better call Bob... Because your build failed โ๐ท๐จโ | |
| Next build failed: View the errors above to see why. | |
| ' | |
| false; | |
| ) | |
| # If everything passes... Now we can commit | |
| # git push origin dev | |
| echo 'โ โ โ โ You win this time... I am pushing this now. โ โ โ โ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment