Last active
October 10, 2024 18:27
-
Star
(108)
You must be signed in to star a gist -
Fork
(30)
You must be signed in to fork a gist
-
-
Save guilherme/9604324 to your computer and use it in GitHub Desktop.
Revisions
-
guilherme revised this gist
Nov 5, 2015 . 1 changed file with 1 addition 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 @@ -9,7 +9,7 @@ consoleregexp='console.log' if test $(git diff --cached | grep $consoleregexp | wc -l) != 0 then exec git diff --cached | grep -ne $consoleregexp read -p "There are some occurrences of console.log at your modification. Are you sure want to continue? (y/n)" yn echo $yn | grep ^[Yy]$ if [ $? -eq 0 ] then -
guilherme revised this gist
Mar 17, 2014 . 1 changed file with 3 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 @@ -4,10 +4,11 @@ exec 1>&2 # enable user input exec < /dev/tty consoleregexp='console.log' # CHECK if test $(git diff --cached | grep $consoleregexp | wc -l) != 0 then exec git diff --cached | grep -ne $consoleregexp read -p "There are some ocurrences of console.log at your modification. Are you sure want to continue? (y/n)" yn echo $yn | grep ^[Yy]$ if [ $? -eq 0 ] -
guilherme created this gist
Mar 17, 2014 .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,19 @@ #!/bin/sh # Redirect output to stderr. exec 1>&2 # enable user input exec < /dev/tty # CHECK if test $(git diff --cached | grep console | wc -l) != 0 then exec git diff --cached | grep -ne console read -p "There are some ocurrences of console.log at your modification. Are you sure want to continue? (y/n)" yn echo $yn | grep ^[Yy]$ if [ $? -eq 0 ] then exit 0; #THE USER WANTS TO CONTINUE else exit 1; # THE USER DONT WANT TO CONTINUE SO ROLLBACK fi fi