Skip to content

Commit

Permalink
Scripts: improve check_new_strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Mar 28, 2021
1 parent 5325973 commit 234a24d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/check_new_strings.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash
# This script is used to check if there are new strings in source files

set -euo pipefail
Expand All @@ -8,19 +8,20 @@ SHA=${GITHUB_SHA:-HEAD~0}
cd "$GIT_DIR" || exit 1

if [[ "$(git show -s --format='%ce' "$SHA")" == "[email protected]" ]]; then
echo "Commit by Weblate, nothing to do." > /dev/stderr
echo "NO_CHANGE"
exit 0
fi

for file in $(git show --pretty="" --name-only "$SHA"); do
if [[ "$file" == *.c ]] || [[ "$file" == *.h ]]; then
if git show "$SHA" "$file" | egrep '^(\+|\-)' | egrep -qw '_\(|N_\('; then
#echo "REGEN"
git show "$SHA" "$file" > /dev/stderr
echo "NO_CHANGE"
echo "REGEN"
exit 0
fi
fi
done

echo "No commit with translation change." > /dev/stderr
echo "NO_CHANGE"

0 comments on commit 234a24d

Please sign in to comment.