From 1626b961a39e254c128886ce34a9a2902e93e945 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 27 Aug 2020 18:50:27 +0200 Subject: git-commit-po-updates.sh: Robustness fixes. --- dist-tools/git-commit-po-updates.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dist-tools/git-commit-po-updates.sh b/dist-tools/git-commit-po-updates.sh index 41b1f65a..f7c4d759 100755 --- a/dist-tools/git-commit-po-updates.sh +++ b/dist-tools/git-commit-po-updates.sh @@ -19,7 +19,7 @@ # 3: new po/*.po files detected set -eu - +unset IFS cd "$(realpath $(dirname $0))/.." # see if Perl has Carp::Always available, @@ -101,9 +101,8 @@ rc=0 if [ -z "$dryrun_pfx" -a -z "$docommit" ] ; then usage 2 ; fi -new_po_files=$(git status --porcelain=v1 po/*.po | egrep '^\?|^.\?' | cut -c4-) -printf "%s" "$new_po_files" \ -| while read nfile ; do +new_po_files=$(git status --porcelain=v1 po/*.po | egrep '^(\?|.\?|A)' | cut -c4-) +for nfile in $new_po_files ; do run "git add" "$nfile" r=$? handle_po "$nfile" "Add new" "for" @@ -128,7 +127,7 @@ if [ -n "$new_po_files" ] ; then printf " %s" "$j" done printf '\n' - rc=3 + if [ $rc -eq 0 ] ; then rc=3 ; fi fi exit $rc -- cgit v1.2.3