summaryrefslogtreecommitdiffstats
path: root/gendocs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'gendocs.sh')
-rwxr-xr-xgendocs.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/gendocs.sh b/gendocs.sh
index d3ff4f5..83c5b93 100755
--- a/gendocs.sh
+++ b/gendocs.sh
@@ -4,6 +4,10 @@ OUTFILENAME="XDS_UsersGuide"
SCRIPT=$(basename $BASH_SOURCE)
+VERSION=$(grep '"version":' $(dirname $BASH_SOURCE)/book.json | cut -d'"' -f 4)
+[ "$VERSION" != "" ] && OUTFILENAME="${OUTFILENAME}_v${VERSION}"
+
+
function usage() {
cat <<EOF >&2
Usage: $SCRIPT [options] [pdf|serve|doxygen]
@@ -47,7 +51,6 @@ while [ $# -gt 0 ]; do
shift
done
-
cd $(dirname $0)
ROOTDIR=`pwd -P`
@@ -66,8 +69,7 @@ if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then
# Update cover when book.json has been changed
[[ $ROOTDIR/book.json -nt $ROOTDIR/docs/cover.jpg ]] && { echo "Update cover files"; $ROOTDIR/docs/resources/make_cover.sh || exit 1; }
- VERSION="_v$(grep '"version":' $ROOTDIR/book.json | cut -d'"' -f 4)"
- OUTFILE=$OUT_DIR/$OUTFILENAME$VERSION.pdf
+ OUTFILE=$OUT_DIR/$OUTFILENAME.pdf
$DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG $ARGS
[ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE"
else