anki/.github/scripts/contrib.sh
evandrocoan 47ccd6638d Added -o pipefail to all set -e ensuring the build fails when some
operation with pipe exits error status.

# Conflicts:
#	Makefile
2020-02-24 20:18:56 -03:00

18 lines
469 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
antispam=", at the domain "
echo "All contributors:"
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/"
headAuthor=$(git log -1 --pretty=format:'%ae')
authorAt=$(echo "$headAuthor" | sed "s/@/$antispam/")
if git log --pretty=format:'%ae' CONTRIBUTORS | grep -qi "$headAuthor"; then
echo "Author $authorAt found in CONTRIBUTORS"
else
echo "Author $authorAt NOT found in list"
exit 1
fi