mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Fix deploy-ebook-to-www script to correctly check if cover image needs to be built
This commit is contained in:
parent
2aa43d9038
commit
991fd61d72
1 changed files with 3 additions and 3 deletions
|
@ -162,6 +162,8 @@ do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
urlSafeIdentifier=$(git show HEAD:src/epub/content.opf | grep --only-matching --extended-regexp "<dc:identifier id=\"uid\">url:https://standardebooks.org/ebooks/[^<]+<\/dc:identifier>" | sed --regexp-extended "s/<[^>]+?>//g" | sed --regexp-extended "s|url:https://standardebooks.org/ebooks/||g" | sed --regexp-extended "s|/|_|g")
|
||||||
|
|
||||||
if [ "${lastPushHash}" != "" ]; then
|
if [ "${lastPushHash}" != "" ]; then
|
||||||
# We were passed the hash of the last push before this one.
|
# We were passed the hash of the last push before this one.
|
||||||
# Check to see if the cover image changed, to decide if we want to rebuild the cover image thumbnail/hero
|
# Check to see if the cover image changed, to decide if we want to rebuild the cover image thumbnail/hero
|
||||||
|
@ -169,7 +171,7 @@ do
|
||||||
|
|
||||||
if [ "${images}" = "true" ]; then
|
if [ "${images}" = "true" ]; then
|
||||||
# Always build images if they don't exist, or if they've changed
|
# 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
|
if [[ ! -f "${webRoot}/www/images/covers/${urlSafeIdentifier}-cover.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"
|
||||||
|
@ -202,8 +204,6 @@ do
|
||||||
printf "Generating cover image for web ... "
|
printf "Generating cover image for web ... "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
urlSafeIdentifier=$(git show HEAD:src/epub/content.opf | grep --only-matching --extended-regexp "<dc:identifier id=\"uid\">url:https://standardebooks.org/ebooks/[^<]+<\/dc:identifier>" | sed --regexp-extended "s/<[^>]+?>//g" | sed --regexp-extended "s|url:https://standardebooks.org/ebooks/||g" | sed --regexp-extended "s|/|_|g")
|
|
||||||
|
|
||||||
git show HEAD:images/cover.jpg > "${imgWorkDir}/${urlSafeIdentifier}.jpg"
|
git show HEAD:images/cover.jpg > "${imgWorkDir}/${urlSafeIdentifier}.jpg"
|
||||||
git show HEAD:images/cover.svg > "${imgWorkDir}/${urlSafeIdentifier}.svg"
|
git show HEAD:images/cover.svg > "${imgWorkDir}/${urlSafeIdentifier}.svg"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue