friendica-docker-ci/transifex/check-addons.sh

18 lines
558 B
Bash
Raw Normal View History

2021-05-22 13:53:49 +02:00
#!/bin/bash
#
# Checks the addons messages.po files
#
DIR=${FRIENDICA_DIR:-$PWD}
ADDON_DIR=${FRIENDICA_ADDON_DIR:-"$DIR/addon"}
cd $ADDON_DIR
# Skip first 4 lines in possible diff, because they're header
# Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date"
2021-05-22 20:08:29 +02:00
if [[ $(git diff -U0 **/messages.po | grep -vE '^(@@|\-"POT-Creation-Date|\+"POT-Creation-Date|\-#|\+#|\-\-\-|\+\+\+|index\ |diff\ \-\-git)' | wc -l) -gt 0 ]]; then
2021-05-22 13:53:49 +02:00
echo "$(git diff **/messages.po)"
exit 1
else
2021-05-22 22:55:44 +02:00
echo "\033[1mNothing to update\033[0m"
2021-05-22 13:53:49 +02:00
fi