Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
good git hooks for rails
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
print_fuck() {
echo "${RED}"
echo " █████▒█ ██ ▄████▄ ██ ▄█▀"
echo "▓██ ▒ ██ ▓██▒▒██▀ ▀█ ██▄█▒ "
echo "▒████ ░▓██ ▒██░▒▓█ ▄ ▓███▄░ "
echo "░▓█▒ ░▓▓█ ░██░▒▓▓▄ ▄██▒▓██ █▄ "
echo "░▒█░ ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄"
echo " ▒ ░ ░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░▒ ▒▒ ▓▒"
echo " ░ ░░▒░ ░ ░ ░ ▒ ░ ░▒ ▒░"
echo " ░ ░ ░░░ ░ ░ ░ ░ ░░ ░ "
echo " ░ ░ ░ ░ ░ "
echo ""
echo "${NC}"
}
print_good_content() {
echo "${GREEN}"
if [ $(tput cols) -gt 105 ];
then
echo ""
echo " ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ██╗████████╗███████╗███╗ ██╗████████╗██╗"
echo "██╔════╝ ██╔═══██╗██╔═══██╗██╔══██╗ ██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██╔════╝████╗ ██║╚══██╔══╝██║"
echo "██║ ███╗██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██╔██╗ ██║ ██║ █████╗ ██╔██╗ ██║ ██║ ██║"
echo "██║ ██║██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║╚██╗██║ ██║ ██╔══╝ ██║╚██╗██║ ██║ ╚═╝"
echo "╚██████╔╝╚██████╔╝╚██████╔╝██████╔╝ ╚██████╗╚██████╔╝██║ ╚████║ ██║ ███████╗██║ ╚████║ ██║ ██╗"
echo " ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝"
echo ""
else
echo ""
echo " ██████ ██▓ ▄████▄ ██ ▄█▀"
echo "▒██ ▒ ▓██▒▒██▀ ▀█ ██▄█▒ "
echo "░ ▓██▄ ▒██▒▒▓█ ▄ ▓███▄░ "
echo " ▒ ██▒░██░▒▓▓▄ ▄██▒▓██ █▄ "
echo "▒██████▒▒░██░▒ ▓███▀ ░▒██▒ █▄"
echo "▒ ▒▓▒ ▒ ░░▓ ░ ░▒ ▒ ░▒ ▒▒ ▓▒"
echo "░ ░▒ ░ ░ ▒ ░ ░ ▒ ░ ░▒ ▒░"
echo "░ ░ ░ ▒ ░░ ░ ░░ ░ "
echo " ░ ░ ░ ░ ░ ░ "
echo ""
echo ""
fi
echo "${NC}"
}
check_var() {
if [ $1 -eq 1 ];
then
print_fuck
exit 1
fi
}
echo "[+] rubocop"
bundle exec rubocop -P
rubocop=$?
check_var $rubocop
echo "[+] rspec"
bundle exec rspec
rspec=$?
check_var $rspec
echo "[+] bundle-audit"
bundle exec bundle-audit check --update --quiet
bundleaudit=$?
check_var $bundleaudit
echo "[+] brakeman"
bundle exec brakeman -q
brakeman=$?
check_var $brakeman
print_good_content
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.