From 984ba0724fd0c96923201e5d4242e63f06ca0a18 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sat, 22 Aug 2020 11:26:22 +0200 Subject: [PATCH] Make correct_strings.sh automatically commit --- correct_strings.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/correct_strings.sh b/correct_strings.sh index 8990221bf7..14881a6849 100755 --- a/correct_strings.sh +++ b/correct_strings.sh @@ -2,6 +2,17 @@ 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 find "$mydir/vector/src/main/res" -name strings.xml -exec \ 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 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" + +git add -A +git commit -m "Automatic SchildiChat string correction" + +popd > /dev/null