summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2018-04-21 00:43:40 +0800
committerxhe <xw897002528@gmail.com>2018-04-21 00:43:40 +0800
commit9206a2e68e83a53312ffda39226f181a46a673d3 (patch)
tree6e40e4234248177912aa57725cfb458c49061e5a
parent6e12c254e1ceaf1a30061c49aabb34d9667bc9e3 (diff)
downloadgettext-tiny-9206a2e68e83a53312ffda39226f181a46a673d3.tar.gz
xgettext: create file with empty outputdir arg
Found when updating neovim. The original one will try `touch ./...file` when outputdir arg is empty. But it failed because cmake passed an absolute path to our script. After my modification, it will still try to touch file in a relative path with a empty outputdir arg, but wont fail when the outputfile arg is an absolute path.
-rwxr-xr-xsrc/xgettext.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xgettext.sh b/src/xgettext.sh
index 4dbd2fa..af28840 100755
--- a/src/xgettext.sh
+++ b/src/xgettext.sh
@@ -103,6 +103,10 @@ while true ; do
done
[ "$outputfile" = "-" ] && exit 0
-[ -z "$outputdir" ] && outputdir=.
[ -z "$outputfile" ] && outputfile=${domain}.po
-touch $outputdir/$outputfile
+
+if [ -z "$outputdir" ]; then
+ touch $outputfile
+else
+ touch $outputdir/$outputfile
+fi