wesnoth/utils/travis/check_utf8.sh
pentarctagon 5e386ef43b Make UTF8 checks fail the build if they find anything.
Also fixes a comment typo in docker_run.sh.

(cherry-picked from commit c456d4b288ca6df59cca3663c10131f2c75e8574)
2018-10-07 03:18:08 +00:00

20 lines
731 B
Bash
Executable File

#!/bin/bash
# Install isutf8 program (from package "moreutils" at least in linux mint) in order to use this script.
#
# This script assumes that the current working directory is the root of the wesnoth repository.
exit_code=0
find src/ -type f -print0 | xargs -0 isutf8 -- || exit_code=1
find data/ -not -name "*.png" -not -name "*.ogg" -not -name "*.jpg" -not -name "*.wav" -not -name "*.gif" -not -name "*.xcf" -type f -print0 | xargs -0 isutf8 -- || exit_code=1
find po/ -type f -print0 | xargs -0 isutf8 -- || exit_code=1
isutf8 changelog.md || exit_code=1
isutf8 players_changelog.md || exit_code=1
isutf8 RELEASE_NOTES || exit_code=1
if [ $exit_code != 0 ]; then
echo "Found invalid UTF8 file(s)!"
fi
exit $exit_code