diff --git a/Documentation/Books/build.sh b/Documentation/Books/build.sh index 3f1e431079..8e60ac3a90 100755 --- a/Documentation/Books/build.sh +++ b/Documentation/Books/build.sh @@ -432,7 +432,7 @@ function build-book() (cd "ppbooks/${NAME}"; gitbook install -g) fi echo "${STD_COLOR} - Building Book ${NAME} ${RESET}" - (cd "ppbooks/${NAME}" && gitbook build "./" "./../../books/${NAME}") + (cd "ppbooks/${NAME}" && gitbook ${GITBOOK_ARGS} build "./" "./../../books/${NAME}") rm -f "./books/${NAME}/HEADER.html" rm -f "./books/${NAME}/FOOTER.html" echo "${STD_COLOR} - deleting markdown files in output (gitbook 3.x bug)" @@ -450,7 +450,7 @@ function build-book-dist() cd "ppbooks/${NAME}" for ext in ${OTHER_MIME}; do OUTPUT="${OUTPUT_DIR}/ArangoDB_${NAME}_${newVersionNumber}.${ext}" - if gitbook "${ext}" ./ "${OUTPUT}"; then + if gitbook ${GITBOOK_ARGS} "${ext}" ./ "${OUTPUT}"; then echo "success building ${OUTPUT}" else exit 1 diff --git a/scripts/generateDocumentation.sh b/scripts/generateDocumentation.sh index 7dc3cdcb31..2c862a6d3b 100755 --- a/scripts/generateDocumentation.sh +++ b/scripts/generateDocumentation.sh @@ -51,6 +51,10 @@ test_tools(){ echo "the latest version." exit 1 fi + if test $(whoami) != "root"; then + cp -a /root/.gitbook/ ~/ + cp -a /root/.npm/ ~/ + fi } main(){ @@ -76,6 +80,13 @@ main(){ fi ./utils/generateSwagger.sh + INSTALLED_GITBOOK_VERSION=$(gitbook ls |grep '*'|sed "s;.*\* ;;") + if test -z "${INSTALLED_GITBOOK_VERSION}"; then + echo "your container doesn't come with a preloaded version of gitbook, please update it." + exit 1 + fi + export GITBOOK_ARGS="--gitbook ${INSTALLED_GITBOOK_VERSION}" + cd Documentation/Books if test -z "$TARGET"; then