mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-12 23:35:50 +00:00
26 lines
449 B
Bash
Executable File
26 lines
449 B
Bash
Executable File
#!/bin/bash
|
|
|
|
ROOT_DIR=$(dirname "$0")/..
|
|
|
|
tmp=$(mktemp)
|
|
exit_code=0
|
|
|
|
for locale_file in $ROOT_DIR/src/locales/*.json
|
|
do
|
|
jq -f $(dirname "$0")/sort_filter.jq $locale_file > "$tmp"
|
|
if [ "$*" == "--fix" ]
|
|
then
|
|
mv "$tmp" $locale_file
|
|
else
|
|
if diff -q "$tmp" $locale_file > /dev/null ;
|
|
then
|
|
: # all good
|
|
else
|
|
exit_code=$?
|
|
echo "$(basename -- $locale_file) is not sorted by keys"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
exit $exit_code
|