Fix some shellcheck issues in init-po-files.

This commit is contained in:
Andrius Štikonas 2023-02-25 22:44:36 +08:00
parent 7dc1083e6a
commit dac5f5ff79
1 changed files with 25 additions and 24 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
# Copyright (C) 2009 Andrius Štikonas <andrius@stikonas.eu>
#
# This program is free software: you can redistribute it and/or modify
@ -14,11 +14,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
source "`dirname $0`/ths-variables"
source "$(dirname "$0")/ths-variables"
source ".ths"
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo "Usage `basename $0` <messages-tree> <pot-tree>"
echo "Usage $(basename "$0") <messages-tree> <pot-tree>"
exit 1
fi
@ -30,19 +30,20 @@ else
pot="trunk-kf5/templates/messages"
fi
wdir="`pwd`"
wdir=$PWD
cd "$pot"
for dir in `ls`; do
for dir in */; do
(
cd "$dir"
podir="$wdir/$messages/$dir"
if [ ! -e "$podir" ]; then
mkdir "$podir"
svn add "$podir"
fi
for file in `find . -name '*.pot'`; do
po=`echo $file | sed 's/.\{1\}$//'`
for file in $(find . -name '*.pot'); do
po=$(echo "$file" | sed 's/.\{1\}$//')
if [ ! -e "$podir/$po" ]; then
echo -e $RED"$dir/$po"$ENDCOLOR
echo -e "${RED}${dir}/${po}${ENDCOLOR}"
msginit -i "$file" -o "$podir/$po" --no-translator
cd "$podir"
svn add "$po"
@ -53,5 +54,5 @@ s/\"%100<10 || n%100>=20) ? 1 : 2);\\n\"/"%100>=20) ? 1 : n%10==0 || (n%100>10 \
rm "$podir/$po"e
fi
done
cd ..
)
done