aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2019-03-21 11:01:43 +0100
committerClément Bénier <clement.benier@iot.bzh>2019-03-21 11:01:43 +0100
commit966e672319813f6d1a68c34d36eb9246f7794440 (patch)
treee80d0b60df3d8cb6e51469c65ddcd80483b17511
parent13adf0d8f14e1088452ab479d7f354755bbfe53e (diff)
baseurl option in setupdocs.sh
- add -b|--baseurl to change the baseurl of the site Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rwxr-xr-xsetupdocs.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/setupdocs.sh b/setupdocs.sh
index dc276b6..698ce2c 100755
--- a/setupdocs.sh
+++ b/setupdocs.sh
@@ -51,13 +51,15 @@ Usage: $PROGNAME [OPTIONS]... [DIRECTORY]
REFERENCE can be a branch, a tag, a commit
-w, --webtemplate-ref=[REFERENCE] webtemplates reference;
REFERENCE can be a branch, a tag, a commit
+ -b, --baseurl=[DST] baseurl of the site, defaut is empty
+ DST must start with /
EOF
exit 1
}
-SHORTOPTS="w:t:d:h"
-LONGOPTS="webtemplate-ref:,doctools-ref:,directory:,debug,help"
+SHORTOPTS="w:t:d:h:b:"
+LONGOPTS="webtemplate-ref:,doctools-ref:,baseurl:,directory:,debug,help"
ARGS=$(getopt -s bash --options $SHORTOPTS \
--longoptions $LONGOPTS --name $PROGNAME -- "$@" )
if [ ! $? -eq 0 ]; then
@@ -73,6 +75,8 @@ while [ "$#" -gt "1" ]; do
ref_doctools=$2; shift 2;;
-d|--directory)
DESTINATION=$2;shift 2;;
+ -b|--baseurl)
+ baseurl=$2;shift 2;;
--debug)
DEBUG=0;shift 2;;
-h|--help)
@@ -111,9 +115,12 @@ debug "GITREF=$GITREF and rev=$rev"
&& { error "Invalid reference between $ref_docswebtemplate and local repo in $DESTINATION"; exit 5; }
#processing cloning or update
if [ -z $GITREF ]; then
- echo "Cloning docwebtemplates and doctools in $DESTINATION"
+ echo "Cloning docwebtemplates and doctools in $DESTINATION with baseurl=${baseurl}"
gitclone $docswebtemplates .
gitcheckout $ref_docswebtemplate
+ if [ ! -z ${baseurl} ]; then
+ sed -i "s|^baseurl:.*$|baseurl: \"${baseurl}\"|g" conf/_dev.yml
+ fi
gitclone $doctools $DOCTOOLSDIR
pushd $DOCTOOLSDIR
gitcheckout $ref_doctools