Created
October 27, 2016 08:16
-
-
Save yanivmo/9a2f47eac16383a22254b2475fb217bb to your computer and use it in GitHub Desktop.
Automatically detect how haimzardous your source is
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/bash | |
total=$(git blame $1 | wc -l) | |
haim=$(git blame $1 | grep -i Haim | wc -l) | |
if [ "$total" -eq "0" ]; then | |
echo "Cannot blame" | |
exit -1 | |
fi | |
let haimzard=haim*100/total | |
if [ "$haimzard" -gt "0" ]; then | |
echo "${haimzard}% haimzardous!" | |
exit -1 | |
else | |
echo "No haimzards detected" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment