]> gitweb.hhaalo.de Git - scantopdf.git/commitdiff
refactor if statemend with or chain createmulitpdfs
authorBastian Dehn <hhaalo@arcor.de>
Sun, 6 Jul 2025 10:15:53 +0000 (12:15 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 6 Jul 2025 10:15:53 +0000 (12:15 +0200)
src/scanbasic.sh

index b273fa64206a4f4c0854466a70695c23ae935dba..51aa0378b7c91553c65c698cf806d89986e0be16 100644 (file)
@@ -182,16 +182,17 @@ createmultipdfs()
                        || errlog "could not delete $tiff" \
                        || return $?
 
-               if [ "$trenn" == "true" ]; then
-                       rm $pdf \
-                               || errlog "could not delete $pdf" \
-                               || return $?
-                       createpdf "$startcount" \
-                               "$((endcount - 1))" \
-                               "$basename" \
-                               || return $?
-                       startcount=$((endcount + 1))
-               fi
+               [ "$trenn" != "true" ] \
+                       || rm $pdf \
+                       || errlog "could not delete $pdf" \
+                       || return $?
+               [ "$trenn" != "true" ] \
+                       || createpdf "$startcount" \
+                       "$((endcount - 1))" \
+                       "$basename" \
+                       || return $?
+               [ "$trenn" != "true" ] \
+                       || startcount=$((endcount + 1))
 
                ((endcount++))
        done