summaryrefslogtreecommitdiffstats
path: root/gendocs.sh
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-19 10:03:59 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-19 10:03:59 +0200
commit84641197edb9df3292c2b86d02f9dee898ae05c3 (patch)
tree7176646b57c3a3ea5ffd97e163431ec9ebfff804 /gendocs.sh
parenta18116240fd36dfc173d8bd0274487b635b54f23 (diff)
Bump to v0.2
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
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