forked from dmwm/PHEDEX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpod.sh
executable file
·58 lines (49 loc) · 1.29 KB
/
pod.sh
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
#!/bin/bash
# Example:
# ./pod.sh ~/www/PHEDEX/PHEDEX_CVS http://cern.ch/wildish/PHEDEX/PHEDEX_CVS
cd `dirname $0`
dest=$1
if [ -z "$dest" ]; then
echo "Destination directory is required."
exit 1
fi
htmlroot=$2
if [ -z "$htmlroot" ]; then
echo "Destination htmlroot is required."
exit 1
fi
css=$3
if [ -z "$css" ]; then
css=/phedex/datasvc/static/phedex_pod.css
echo "Using default CSS file: $css"
echo "Copy (and edit) that file if you want something different..."
fi
version=`cat ../VERSION`
ssss="$dest/$version"
index="$dest/index.html"
for dir in `find . -type d -print | grep -v CVS`; do
echo -n "Check existence of $dest/$dir: "
if [ -d "$dest/$dir" ]; then
echo "OK"
else
echo "creating..."
mkdir -p $dest/$dir || exit 1
fi
done
echo "<html>
<head>PhEDEx module index for version $version</head>
<body class='phedex-doc'>
<ul>
" | tee $index >/dev/null
for f in `find . -type f -name '*.pm' | sort`; do
echo "Podding $f..."
g=`echo $f | sed -e 's%pm$%html%'`
pm=`echo $f | sed -e 's%pm$%%' -e 's%^\./%%' -e 's%/%::%g'`
pod2html --infile $f --outfile $dest/$g --header --htmlroot $htmlroot \
-css http://cern.ch/wildish/PHEDEX/phedex_pod.css
echo "<li><a href='$g'>$pm</a></li>" >> $index
done
echo "</ul>
</body>
</html>" >> $index
echo "Finished..."