diff options
author | Stéphane Desneux <stephane.desneux@iot.bzh> | 2017-06-20 09:25:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@automotivelinux.org> | 2017-06-20 09:25:03 +0000 |
commit | dbc0eb2d3b3097e6d3b1cfee045d160f42c1beb2 (patch) | |
tree | a58ba27114ca95a2644a429d76d9784db9590459 /gendocs.sh | |
parent | 793e30e4b03efbb48bd79c0c5ee67ee167a9d86b (diff) | |
parent | 345940889ad4bbd6dd4d4f1a441c283c96ab2364 (diff) |
Merge "Auto generate cover from book.json fields."
Diffstat (limited to 'gendocs.sh')
-rwxr-xr-x | gendocs.sh | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,9 +1,13 @@ #!/bin/bash -OUTFILENAME="Application-Framework-Service" +OUTFILENAME="Application-Framework-Service-Guide" SCRIPT=$(basename $BASH_SOURCE) +VERSION=$(grep '"version":' $(dirname $BASH_SOURCE)/book.json | cut -d'"' -f 4) +[ "$VERSION" != "" ] && OUTFILENAME="${OUTFILENAME}_${VERSION}" + + function usage() { cat <<EOF >&2 Usage: $SCRIPT [options] [pdf|serve|doxygen] @@ -59,6 +63,10 @@ if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; } if [ "$DO_ACTION" = "pdf" ]; 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; } + OUTFILE=$OUT_DIR/$OUTFILENAME.pdf $DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG [ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE" |