1
0
mirror of https://github.com/ru-de/faq.git synced 2024-09-19 19:41:28 +00:00
faq-de/files/.travis.sh

32 lines
959 B
Bash
Raw Normal View History

2016-01-18 23:38:49 +00:00
#!/bin/bash
2016-01-19 08:15:30 +00:00
DIR=`dirname $0`
2016-01-18 23:38:49 +00:00
EXIT_CODE=0
2016-01-19 08:15:30 +00:00
go build -o $DIR/spell-checker $DIR/spell-checker.go
git diff HEAD^ --name-status | grep "^D" -v | awk '{print $2}' > changed_files
2016-01-18 23:38:49 +00:00
while read FILE; do
echo -n "Проверка файла $FILE на опечатки... ";
OUTPUT_RU=$(cat "$FILE" | hunspell -d russian-aot,en_US,de_DE,$DIR/dictionary | $DIR/spell-checker);
2016-01-18 23:38:49 +00:00
RU_EXIT_CODE=$?
OUTPUT_EN=$(cat "$FILE" | hunspell -d en_US,russian-aot,de_DE,$DIR/dictionary | $DIR/spell-checker);
2016-01-18 23:38:49 +00:00
EN_EXIT_CODE=$?
OUTPUT_DE=$(cat "$FILE" | hunspell -d de_DE,en_US,russian-aot,$DIR/dictionary | $DIR/spell-checker);
DE_EXIT_CODE=$?
2016-01-18 23:38:49 +00:00
if [ $RU_EXIT_CODE -ne 0 ] || [ $EN_EXIT_CODE -ne 0 ] || [ $DE_EXIT_CODE -ne 0 ]; then
2016-01-18 23:38:49 +00:00
EXIT_CODE=1;
echo "ошибка";
echo "$OUTPUT_RU\n$OUTPUT_EN\n$OUTPUT_DE" | sort -n -k2 | uniq;
2016-01-18 23:38:49 +00:00
else
echo "пройдена";
fi
echo
2016-01-18 23:38:49 +00:00
done < changed_files
2016-01-19 08:52:01 +00:00
exit $EXIT_CODE