Update deploy-ebook-to-www to prevent it from destroying the new releases XML file if there's an error in an ebook

This commit is contained in:
Alex Cabal 2021-10-08 20:01:55 -05:00
parent 426ccb02fb
commit ac812085db

View file

@ -400,7 +400,12 @@ if [ "${verbose}" = "true" ]; then
printf "Rebuilding new releases RSS feed ... " printf "Rebuilding new releases RSS feed ... "
fi fi
bash -c "php \"${scriptsDir}\"/generate-rss.php --webroot \"${webRoot}\" --weburl \"${webUrl}\" > \"${webRoot}\"/www/rss/new-releases.xml" output=$(php "${scriptsDir}/generate-rss.php" --webroot "${webRoot}" --weburl "${webUrl}")
# Check the return code; if the script failed (for example invalid XML in content.opf), don't overwrite the existing feed with a blank file
if [ $? = 0 ]; then
echo "${output}" > "${webRoot}/www/rss/new-releases.xml"
fi
if [ "${verbose}" = "true" ]; then if [ "${verbose}" = "true" ]; then
printf "Done.\n" printf "Done.\n"