Update ebook deploy script to always generate covers/downloads if they don't yet exist, even with --last-push-hash

This commit is contained in:
Alex Cabal 2021-01-25 18:15:15 -06:00
parent 003b6faad5
commit d52bba5aa1

View file

@ -168,7 +168,8 @@ do
diff=$(git diff "${lastPushHash}" HEAD) diff=$(git diff "${lastPushHash}" HEAD)
if [ "${images}" = "true" ]; then 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" images="true"
else else
images="false" images="false"
@ -177,7 +178,8 @@ do
if [ "${build}" = "true" ]; then if [ "${build}" = "true" ]; then
# Check to see if the actual ebook changed, to decide if we want to build # 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" build="true"
else else
build="false" build="false"