From f650353cf9da367fb5622439edbd2297c98ae5d0 Mon Sep 17 00:00:00 2001 From: Scott Alfter Date: Tue, 7 Jan 2025 14:20:59 -0800 Subject: [PATCH] some fixes --- db-update.py | 0 html-to-epub.sh | 7 ++++--- update-mirror.sh | 1 + update.sh | 8 +++++--- 4 files changed, 10 insertions(+), 6 deletions(-) mode change 100644 => 100755 db-update.py mode change 100644 => 100755 html-to-epub.sh mode change 100644 => 100755 update-mirror.sh mode change 100644 => 100755 update.sh diff --git a/db-update.py b/db-update.py old mode 100644 new mode 100755 diff --git a/html-to-epub.sh b/html-to-epub.sh old mode 100644 new mode 100755 index c050150..d9a5c62 --- a/html-to-epub.sh +++ b/html-to-epub.sh @@ -5,16 +5,17 @@ for srcdir in $(find html-src -name \*-h -type d) do srcfile=$(echo $srcdir/$(basename $srcdir).htm) prefix=$(basename -s -h.htm $srcfile) - echo $prefix + echo $prefix" " | tr "\n" "\r" destpath=$(echo $(dirname $(dirname $srcfile)) | sed "s/^html-src/ebooks/") mkdir -p $destpath if [ $srcfile -nt $destpath/$prefix.epub ] then - ebookmaker --make kindle.images --generate_cover --output-dir $destpath $srcfile 2>&1 >/dev/null + echo "" + docker run --rm -v $PWD:$PWD cr.gitlab.alfter.us/salfter/ebookmaker --make kindle.images --generate_cover --output-dir $PWD/$destpath $PWD/$srcfile 2>&1 >/dev/null coverfile=$(ls $destpath/*.png) if [ "$coverfile" != "" ] then - ebookmaker --make kindle.images --cover $coverfile --output-dir $destpath $srcfile 2>&1 >/dev/null + docker run --rm -v $PWD:$PWD cr.gitlab.alfter.us/salfter/ebookmaker --make kindle.images --cover $coverfile --output-dir $PWD/$destpath $PWD/$srcfile 2>&1 >/dev/null fi rm -f $destpath/$prefix.epub $destpath/$prefix.mobi 2>&1 >/dev/null mv $destpath/*.epub $destpath/$prefix.epub diff --git a/update-mirror.sh b/update-mirror.sh old mode 100644 new mode 100755 index 0ad80a9..fe840cb --- a/update-mirror.sh +++ b/update-mirror.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +echo $LIBRARY_PATH rsync -avz aleph.gutenberg.org::gutenberg-epub/feeds/pg_catalog.csv . rsync -avz --delete --delete-excluded --exclude "/images/" --exclude "/pg/" --exclude "/retired/" --exclude "/cache/" --exclude "*/*-page-images/*" --exclude "*/*-page-images/" --exclude "*/old/*" --exclude "*/old/" --include "*/" --include "*.htm" --include "*.jpg" --include "*.png" --include "*.gif" --exclude "*" aleph.gutenberg.org::gutenberg $LIBRARY_PATH/html-src rm html-src/hosted-by-ibiblio.png diff --git a/update.sh b/update.sh old mode 100644 new mode 100755 index 05eb1ce..fad1248 --- a/update.sh +++ b/update.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash -update-mirror.sh -db-update.py -html-to-epub.sh + +source ./env +./update-mirror.sh +./db-update.py +./html-to-epub.sh