From d52bba5aa12c10af7491b90126b291bf45379288 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 25 Jan 2021 18:15:15 -0600 Subject: [PATCH] Update ebook deploy script to always generate covers/downloads if they don't yet exist, even with --last-push-hash --- scripts/deploy-ebook-to-www | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index 5ee122cd..e90bba5a 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -168,7 +168,8 @@ do diff=$(git diff "${lastPushHash}" HEAD) if [ "${images}" = "true" ]; then - if [[ "${diff}" =~ diff\ --git\ a/images/cover.jpg ]] || [[ "${diff}" =~ diff\ --git\ a/images/cover.svg ]]; then + # Always build images if they don't exist, or if they've changed + if [[ ! -f "${webRoot}/www/images/covers/${urlSafeIdentifier}.jpg" ]] || [[ "${diff}" =~ diff\ --git\ a/images/cover.jpg ]] || [[ "${diff}" =~ diff\ --git\ a/images/cover.svg ]]; then images="true" else images="false" @@ -177,7 +178,8 @@ do if [ "${build}" = "true" ]; then # Check to see if the actual ebook changed, to decide if we want to build - if [[ "${diff}" =~ diff\ --git\ a/src/ ]]; then + # Always build if it doesn't exist + if [[ ! -f "${webDir}/downloads/*.epub" ]] || [[ "${diff}" =~ diff\ --git\ a/src/ ]]; then build="true" else build="false"