From ce43a617386ef0e9ed57f7d46a537c3bae157082 Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 23 Jan 2018 00:12:23 +0800 Subject: xgettext: touch the file correctly It's obviously wrong that touching files under outputdir, when output dir is empty. Also, the original code is too complex, it should be done with less and tidy code. --- src/xgettext.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/xgettext.sh b/src/xgettext.sh index 42769a5..4dbd2fa 100755 --- a/src/xgettext.sh +++ b/src/xgettext.sh @@ -1,5 +1,4 @@ #!/bin/sh - outputfile= outputdir= domain=messages @@ -104,13 +103,6 @@ while true ; do done [ "$outputfile" = "-" ] && exit 0 -if [ -z "$outputfile" ] ; then - outputfile=${domain}.po - [ -z "$outputdir" ] && outputdir=. - touch $outputdir/$outputfile -else - [ -z "$outputdir" ] && touch $outputdir/$outputfile || \ - touch $outputfile -fi - - +[ -z "$outputdir" ] && outputdir=. +[ -z "$outputfile" ] && outputfile=${domain}.po +touch $outputdir/$outputfile -- cgit v1.2.1