chore: Add even more Shellcheck suggestions

This commit is contained in:
Carlos Solís 2025-01-24 19:34:48 +00:00
parent 06356b6d1c
commit efe59ecfbf
6 changed files with 86 additions and 86 deletions

View file

@ -40,13 +40,13 @@ IFS="
while read s
do
nice -n 15 cwebp -mt -af -quiet "${s}" -o /tmp/"${s##.*\/}"_temp.webp
if [ -f /tmp/"${s##.*\/}"_temp.webp ]
if [[ -f /tmp/"${s##.*\/}"_temp.webp ]]
then
size_new=$(stat -c%s /tmp/"${s##.*\/}"_temp.webp)
size_original=$(stat -c%s "${s}")
if [ "$size_original" -gt "$size_new" ]
if [[ "${size_original}" -gt "${size_new}" ]]
then
mv /tmp/"${s##.*\/}"_temp.webp "$s"
mv /tmp/"${s##.*\/}"_temp.webp "${s}"
else
rm /tmp/"${s##.*\/}"_temp.webp
fi