Files
i18n/tools/check-zanata-users-list.sh
Frank Kloeker cd44236152 move tox jobs and I18n tools to Python3
Change-Id: I53f840e6c5e5d6656255c76f14fb5b5bf08e57f3
2018-09-11 22:31:33 +02:00

33 lines
770 B
Bash
Executable File

#!/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
python3 tools/zanata/zanata_users.py --output-file $TMPFILE
if ! diff -u $TEAM_LIST $TMPFILE; then
set -x
cat <<EOF
The proposed $TEAM_LIST does not match the current Zanata team member list.
Consider reproposing it after syncing it with Zanata.
To do so, run 'tox -e zanata-users-sync'.
EOF
set +x
exit 1
fi