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