Created
September 16, 2020 07:07
-
-
Save robbestad/0b659f5ce16f8e209818e9cabc28589b to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Redirect output to stderr. | |
exec 1>&2 | |
# enable user input | |
exec < /dev/tty | |
staged=' -U0' | |
cached=' --cached' | |
# CHECK | |
if test $(git diff $cached | egrep '^\+.*console\.log' | wc -l) != 0 | |
then | |
echo "Funnet console.logs i følgende filer: " | |
exec git diff $cached | egrep '(^\+{3})|^\+.*console\.log.*' | egrep '(^\+{3})' | |
read -p "Vil du fortsette? (j/n)" yn | |
echo $yn | grep ^[YyJj]$ | |
if [ $? -eq 0 ] | |
then | |
exit 0; #fortsett | |
else | |
exit 1; #stopp | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment