From 4b3d9e29ae7d2da9d4da03214128257c1325dc58 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Fri, 15 Apr 2022 09:07:35 -0500 Subject: [PATCH] corrects if statement and corrects output path --- build-book-converter.jenkins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-book-converter.jenkins b/build-book-converter.jenkins index da9fc6a..ac266d1 100644 --- a/build-book-converter.jenkins +++ b/build-book-converter.jenkins @@ -53,9 +53,9 @@ IFS=\$'\\n' while true; do sleep 5s - if [ -z "\$(find /calibre/input -type f \\( -iname "*.mobi" -o -iname "*.epub" -o -iname "*.prc" \\) -print -quit)" ]; then + if [ ! -z "\$(find /calibre/input -type f \\( -iname "*.mobi" -o -iname "*.epub" -o -iname "*.prc" \\) -print -quit)" ]; then for i in \$(find /calibre/input -type f \\( -iname "*.mobi" -o -iname "*.epub" -o -iname "*.prc" \\)); do - /opt/calibre/ebook-convert "\${i}" "/calibre/output/\${i%.*}.azw3" + /opt/calibre/ebook-convert "\${i}" "/calibre/output/\$(basename \${i%.*}.azw3)" rm -f -v "\${i}" done fi