diff options
author | 2017-06-20 09:25:01 +0000 | |
---|---|---|
committer | 2017-06-20 09:25:01 +0000 | |
commit | 682c21ba91959a333df943bb33d617269f10878c (patch) | |
tree | 9a09d6875bfc8a5e41f196548900ca01ccba7cd0 /gendocs.sh | |
parent | 576b24cfff99a347ddefda53aecf98334c030096 (diff) | |
parent | 3081bce9632e29c7ecebf547360cc78c170470cd (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-Binder" +OUTFILENAME="Application-Framework-Binder-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" |