Merge pull request #3 from camlafit/patch-1

Prevent error with file and space
This commit is contained in:
VirtuBox 2019-05-17 12:25:50 +02:00 committed by GitHub
commit 347490b7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,7 +178,7 @@ if [ "$WEBP_OPTIMIZATION" = "y" ]; then
echo -ne ' png to webp conversion [..]\r'
cd "$IMG_PATH" || exit 1
find . -type f -iname "*.png" -print0 | xargs -0 -I {} \
bash -c '[ ! -f "{}.webp" ] && { cwebp -z 9 -mt {} -o {}.webp; }'
bash -c '[ ! -f "{}.webp" ] && { cwebp -z 9 -mt "{}" -o "{}.webp"; }'
echo -ne " png to webp conversion [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
@ -187,7 +187,7 @@ if [ "$WEBP_OPTIMIZATION" = "y" ]; then
echo -ne ' jpg to webp conversion [..]\r'
cd "$IMG_PATH" || exit 1
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -print0 | xargs -0 -I {} \
bash -c '[ ! -f "{}.webp" ] && { cwebp -q 82 -mt {} -o {}.webp; }'
bash -c '[ ! -f "{}.webp" ] && { cwebp -q 82 -mt "{}" -o "{}.webp"; }'
echo -ne " jpg to webp conversion [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'