anki/.github/scripts/contrib.sh

18 lines
459 B
Bash
Raw Normal View History

2020-01-06 06:37:21 +01:00
#!/bin/bash
set -e
2020-01-15 11:34:10 +01:00
antispam=", at the domain "
echo "All contributors:"
2020-01-15 11:34:10 +01:00
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/"
2020-01-06 06:37:21 +01:00
headAuthor=$(git log -1 --pretty=format:'%ae')
2020-01-15 11:34:10 +01:00
authorAt=$(echo "$headAuthor" | sed "s/@/$antispam/")
if git log --pretty=format:'%ae' CONTRIBUTORS | grep -qi "$headAuthor"; then
2020-01-15 11:34:10 +01:00
echo "Author $authorAt found in CONTRIBUTORS"
else
2020-01-15 11:34:10 +01:00
echo "Author $authorAt NOT found in list"
exit 1
fi