summaryrefslogtreecommitdiff
path: root/src/xgettext.sh
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2018-01-23 00:12:23 +0800
committerxhe <xw897002528@gmail.com>2018-01-23 00:12:23 +0800
commitce43a617386ef0e9ed57f7d46a537c3bae157082 (patch)
tree219e35a08e8ce08f7f1f94d720dd903f31f45440 /src/xgettext.sh
parent5ecedfd4fd575495023aec97a23ed17f7001d015 (diff)
downloadgettext-tiny-ce43a617386ef0e9ed57f7d46a537c3bae157082.tar.gz
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.
Diffstat (limited to 'src/xgettext.sh')
-rwxr-xr-xsrc/xgettext.sh14
1 files 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