From 82d73c67a82faf9d316f304163c3b87997e582fb Mon Sep 17 00:00:00 2001 From: Km Date: Fri, 17 May 2019 10:57:49 +0200 Subject: [PATCH] Prevent error with file and space Preserve name spacing when webp run --- optimize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optimize.sh b/optimize.sh index 0921fb1..1c2548c 100755 --- a/optimize.sh +++ b/optimize.sh @@ -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'