Make correct_strings.sh automatically commit

This commit is contained in:
SpiritCroc 2020-08-22 11:26:22 +02:00
parent ce90a36891
commit 984ba0724f
1 changed files with 16 additions and 0 deletions

View File

@ -2,6 +2,17 @@
mydir="$(dirname "$(realpath "$0")")" mydir="$(dirname "$(realpath "$0")")"
pushd "$mydir" > /dev/null
# Require clean git state
uncommitted=`git status --porcelain`
if [ ! -z "$uncommitted" ]; then
echo "Uncommitted changes are present, please commit first!"
exit 1
fi
mydir="."
# Element -> SchildiChat # Element -> SchildiChat
find "$mydir/vector/src/main/res" -name strings.xml -exec \ find "$mydir/vector/src/main/res" -name strings.xml -exec \
sed -i 's|Element|SchildiChat|g' '{}' \; sed -i 's|Element|SchildiChat|g' '{}' \;
@ -18,3 +29,8 @@ find "$mydir/vector/src/main/res" -name strings.xml -exec \
# Requires manual intervention for correct grammar # Requires manual intervention for correct grammar
sed -i 's|!nnen|wolpertinger|g' "$mydir/vector/src/main/res/values-de/strings.xml" sed -i 's|!nnen|wolpertinger|g' "$mydir/vector/src/main/res/values-de/strings.xml"
sed -i 's|!n|schlumpfwesen|g' "$mydir/vector/src/main/res/values-de/strings.xml" sed -i 's|!n|schlumpfwesen|g' "$mydir/vector/src/main/res/values-de/strings.xml"
git add -A
git commit -m "Automatic SchildiChat string correction"
popd > /dev/null