summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVitaly Minko <vitaly.minko@gmail.com>2018-12-04 18:09:03 +0300
committerVitaly Minko <vitaly.minko@gmail.com>2018-12-04 18:09:03 +0300
commit52889308a462b5818cb25950e714e51139495188 (patch)
tree0b7c3940d7eb77000f973e57cfeb89b86becd1b7 /utils
parent3a3030f910fcd2c1b61bbd012c2740ef42d627ce (diff)
Fixed error in generate_docs.sh.
Diffstat (limited to 'utils')
-rwxr-xr-xutils/generate_docs.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/generate_docs.sh b/utils/generate_docs.sh
index 866255c..e4c8943 100755
--- a/utils/generate_docs.sh
+++ b/utils/generate_docs.sh
@@ -5,7 +5,7 @@
#
# Copyright (c) 2018 Vitaly Minko <vitaly.minko@gmail.com>
-EXCLUDED_DIRS="docs utils"
+EXCLUDED_DIRS="docs utils testbed"
STATIC_DIR="$GOPATH/src/golang.org/x/tools/godoc/static/"
die() {
@@ -38,16 +38,17 @@ generate_htmls() {
done
# Replace target URI
- find ${target_dir} -name index.html -exec \
- sed -i "s|/lib/godoc/|${target_uri}${target_dir}/|" {} \; || \
- die "failed to replace target URI in a static"
+ find ${target_dir} -name index.html \
+ -exec sed -i "s|/lib/godoc/|${target_uri}${target_dir}/|g" {} \; \
+ -exec sed -i "s|/pkg/${package}/|${target_uri}${target_dir}/|g" {} \; || \
+ die "failed to replace target URI in a static"
}
copy_statics() {
local target_dir=$1
local target_uri=$2
local statics=`grep "${target_uri}${target_dir}" ${target_dir}/index.html | \
- sed -n "s|.*${target_uri}${target_dir}\(.*\)\".*|\1|p"`
+ sed -n "s|.*${target_uri}${target_dir}/\([^#\/]\+\)\".*|\1|p"`
for static in ${statics}; do
cp ${STATIC_DIR}${static} ${target_dir} || die "failed to copy a static"
done
@@ -57,7 +58,7 @@ if [ $# -ne 3 ]
then
cat >&2 << EOF
Usage:
- $0 <package> <target_dir> <host_prefix>
+ $0 <package> <target_dir> <target_uri>
where,
<package> is the root package to generate documentation for.
<target_dir> is the directory to put the result in.