aboutsummaryrefslogtreecommitdiff
path: root/doc/asciidoc-helper.sh
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-02-27 17:06:06 +0100
committerSebastian Hahn <sebastian@torproject.org>2010-03-01 04:07:55 +0100
commit0cd1b499b46fa112e0d81e467a0d07f79e04bbdb (patch)
tree4fe96b8c252b200c1f0d5c0d146ec90b9e73ff8c /doc/asciidoc-helper.sh
parentf9de12b864cc2b2fd5c3327f9dccf16deeefb483 (diff)
downloadtor-0cd1b499b46fa112e0d81e467a0d07f79e04bbdb.tar
tor-0cd1b499b46fa112e0d81e467a0d07f79e04bbdb.tar.gz
Simplify asciidoc-helper
We don't need sed for our string manipulation, so let's get rid of it. Suggested by weasel.
Diffstat (limited to 'doc/asciidoc-helper.sh')
-rwxr-xr-xdoc/asciidoc-helper.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/asciidoc-helper.sh b/doc/asciidoc-helper.sh
index 90a003d49..25b438cd8 100755
--- a/doc/asciidoc-helper.sh
+++ b/doc/asciidoc-helper.sh
@@ -4,19 +4,19 @@
# See LICENSE for licensing information
# Run this to generate .html.in or .1.in files from asciidoc files.
# Arguments:
-# html|man asciidocpath sedpath outputfile
+# html|man asciidocpath outputfile
set -e
-if [ $# != 4 ]; then
+if [ $# != 3 ]; then
exit 1;
fi
-output=$4
-input=`echo $output | $3 -e 's/html\.in$/1\.txt/g' -e 's/1\.in$/1\.txt/g'`
-base=`echo $output | $3 -e 's/\.html\.in$//g' -e 's/\.1\.in$//g'`
+output=$3
if [ "$1" = "html" ]; then
+ input=${output%%.html.in}.1.txt
+ base=${output%%.html.in}
if [ "$2" != none ]; then
"$2" -d manpage -o $output $input;
else
@@ -29,6 +29,9 @@ if [ "$1" = "html" ]; then
echo "==================================";
fi
elif [ "$1" = "man" ]; then
+ input=${output%%.1.in}.1.txt
+ base=${output%%.1.in}
+
if test "$2" != none; then
if $2 -f manpage $input; then
mv $base.1 $output;