diff --git a/tools/check-zanata-users-list.sh b/tools/check-zanata-users-list.sh new file mode 100755 index 0000000..3f9f0e8 --- /dev/null +++ b/tools/check-zanata-users-list.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -ex + +TEAM_LIST=tools/zanata/translation_team.yaml + +# This is to detect the change of the team list location. +# It is just a safe guard. +if [ ! -f $TEAM_LIST ]; then + echo "$TEAM_LIST not found. Something wrong." + exit 1 +fi + +if ! git diff --name-only HEAD^ | grep -q $TEAM_LIST; then + echo "The recent commit does not touch $TEAM_LIST, so skipping the check." + exit 0 +fi + +TMPFILE=`mktemp` +trap "rm -f $TMPFILE" EXIT + +python tools/zanata/zanata_users.py --output-file $TMPFILE +if ! diff -u $TEAM_LIST $TMPFILE; then + set -x + cat <