Skip to content

Commit cbcbad0

Browse files
committed
more weblate script improvements
1 parent 45d9122 commit cbcbad0

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

scripts/wlpull

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ do
137137

138138
# percents
139139
# skip english
140+
# strip ms and TZ
140141
PERCS=`grep '^translated_percent: ' "$TMP" | cut -c 21- | tail -n +2`
141142
PERCS=`echo "$PERCS" | tr '\n' ' '`
142143
if [ -z "$PERCS" ]
@@ -190,12 +191,17 @@ do
190191
echo "ERROR: Cannot get weblate date for $FILE"
191192
exit 1
192193
fi
193-
# get local checkin timestamp
194-
TSL=`git log -1 --format=%at "$FILE"`
195-
if [ "$?" -ne 0 ]
194+
if [ -f "$FILE" ]
196195
then
197-
echo "ERROR: Cannot get git commit date for $FILE"
198-
exit 1
196+
# get local checkin timestamp
197+
TSL=`git log -1 --format=%at "$FILE"`
198+
if [ "$?" -ne 0 -a -z "$L" ]
199+
then
200+
echo "ERROR: Cannot get git commit date for $FILE"
201+
exit 1
202+
fi
203+
else
204+
TSL=0
199205
fi
200206
if [ -z "$TSL" ]
201207
then
@@ -219,13 +225,16 @@ do
219225
RC=1
220226
continue
221227
fi
222-
diff -q "$TMP" "$FILE" > /dev/null
223-
if [ "$?" -eq 0 ]
228+
if [ -f "$FILE" ]
224229
then
225-
# Weblate timestamp newer after initial import
226-
echo "NO CHANGES in $W/$LANG for $FILE"
227-
rm -f "$TMP"
228-
continue
230+
diff -q "$TMP" "$FILE" > /dev/null
231+
if [ "$?" -eq 0 ]
232+
then
233+
# Weblate timestamp newer after initial import
234+
echo "NO CHANGES in $W/$LANG for $FILE"
235+
rm -f "$TMP"
236+
continue
237+
fi
229238
fi
230239
mv "$TMP" "$FILE"
231240
if [ "$?" -ne 0 ]

0 commit comments

Comments
 (0)