Fix bash -c

This commit is contained in:
VirtuBox 2019-08-29 18:27:51 +02:00
parent 0fa994d9ec
commit 673889e740
Signed by: virtubox
GPG Key ID: 22EB296C97BAD476
2 changed files with 13 additions and 4 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

View File

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