Skip to content

Instantly share code, notes, and snippets.

@nwoow
Created November 1, 2021 12:22
Show Gist options
  • Select an option

  • Save nwoow/cf90a089beaf21fa5247e5e2bf99745c to your computer and use it in GitHub Desktop.

Select an option

Save nwoow/cf90a089beaf21fa5247e5e2bf99745c to your computer and use it in GitHub Desktop.
#!/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. โœ…โœ…โœ…โœ…'
#!/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