From dd43efd450741799c992ab67731eca4b855094d9 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 29 Aug 2020 14:43:10 -0500 Subject: [PATCH] Add --no-epubcheck option to deploy-ebook-to-www script --- scripts/deploy-ebook-to-www | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index 7910e7d4..03cf17b4 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -6,12 +6,14 @@ DESCRIPTION Deploy a Standard Ebook source repository to the web. USAGE - deploy-ebook-to-www [-v,--verbose] [-g,--group GROUP] [--webroot WEBROOT] [--weburl WEBURL] [--no-images] [-l,--last-push-hash HASH] DIRECTORY [DIRECTORY...] + deploy-ebook-to-www [-v,--verbose] [-g,--group GROUP] [--webroot WEBROOT] [--weburl WEBURL] [--no-images] [--no-epubcheck] [-l,--last-push-hash HASH] DIRECTORY [DIRECTORY...] DIRECTORY is a bare source repository. GROUP is a groupname. Defaults to "se". WEBROOT is the path to your webroot. Defaults to "/standardebooks.org". WEBURL is the URL the website is served on. Defaults to "https://standardebooks.org". + With --no-epubcheck, run 'build' instead of 'build --check'. + With --last-push-hash, check the repo head against HASH to see if the cover image or ebook source changed, which will determine if cover thumbnails get re-generated or the ebook gets re-built. With --no-images, do not create cover thumbnails or hero images for the web. @@ -29,6 +31,7 @@ group="se" webRoot="/standardebooks.org/web" webUrl="https://standardebooks.org" lastPushHash="" +epubcheck="true" if [ $# -eq 0 ]; then usage @@ -66,6 +69,10 @@ while [ $# -gt 0 ]; do images="false" shift 1 ;; + --no-epubcheck) + epubcheck="false" + shift 1 + ;; *) break ;; esac done @@ -221,9 +228,16 @@ do mkdir "${workDir}/dist" # Build the ebook - if ! se build --output-dir="${workDir}/dist" --check --kindle --kobo --covers "${workDir}"; then - rm --preserve-root --recursive --force "${workDir}" - die "Error building ebook, stopping deployment." + if [ "${epubcheck}" = "true" ]; then + if ! se build --output-dir="${workDir}/dist" --check --kindle --kobo --covers "${workDir}"; then + rm --preserve-root --recursive --force "${workDir}" + die "Error building ebook, stopping deployment." + fi + else + if ! se build --output-dir="${workDir}/dist" --kindle --kobo --covers "${workDir}"; then + rm --preserve-root --recursive --force "${workDir}" + die "Error building ebook, stopping deployment." + fi fi if [ "${verbose}" = "true" ]; then