From c8690afa3b3b57e209852ba147ab5231a0563f96 Mon Sep 17 00:00:00 2001 From: Ze'ev Schurmann Date: Tue, 19 Sep 2023 17:59:31 +0200 Subject: [PATCH] v0.5 Fixed bug: If previous session crashed temp files were still existing and would be incorporated into the next conversion. --- cbr2cbz.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cbr2cbz.sh b/cbr2cbz.sh index b258f0c..4b56d5c 100755 --- a/cbr2cbz.sh +++ b/cbr2cbz.sh @@ -2,7 +2,7 @@ function Help { echo "cbr2cbz Conversion Tool" - echo "Version 0.4" + echo "Version 0.5" echo "https://git.zaks.web.za/thisiszeev/cbr2cbz" echo echo 'Usage: cbr2cbz single "filename.cbr"' @@ -49,6 +49,7 @@ function Convert { } function BatchRun { + rm -R "/tmp/cbr2cbz" mkdir -p "/tmp/cbr2cbz" find . -type f -name "*.cbr" > /tmp/cbr2cbz.list files=$( cat /tmp/cbr2cbz.list | wc -l ) @@ -79,6 +80,7 @@ then echo "If filename has spaces or special characters please pass it within quotes." Help fi + rm -R "/tmp/cbr2cbz" cbr=$2 size=$(( ${#cbr} - 1 )) cbz="${cbr:0:$size}z"