-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjdevhelp-jar.sh
More file actions
executable file
·63 lines (55 loc) · 1.55 KB
/
Copy pathjdevhelp-jar.sh
File metadata and controls
executable file
·63 lines (55 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# jdevhelp-jar.sh - install javadoc artifact as Devhelp book
# Copyright 2013 Eric Le Lay wanadoo.fr:neric27
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
usage="Usage: $0 <xxx-javadoc.jar> [name]"
if [ "" == "$1" ]; then
echo $usage
exit -1
elif [ ! -f "$1" ]; then
echo $usage
echo "File $1 doesn't exist or is not a file"
exit -1
else
jar=$1
fi
set -x
if [ "" == "$2" ]; then
jarname=`basename $1`
name=${jarname%-javadoc.jar}
if [ "$name" == "$jarname" ]; then
echo $usage
echo "File $1 doesn't end in -javadoc.jar"
exit -1
fi
else
name=$2
fi
share=${XDG_DATA_HOME:-~/.local/share}
booksdir=$share/devhelp/books
if [ ! -d "$booksdir" ]; then
mkdir -p "$booksdir"
fi
book=$booksdir/$name
mkdir "$book"
unzip $jar -d "$book"
me=`realpath $0`
mydir=`dirname "$me"`
transform="$mydir/transform.xsl"
tsaxon="$mydir/tsaxon.sh"
$tsaxon "$book/allclasses-noframe.html" \
"$transform" \
"$book/$name.devhelp2" \
"name=$name"