From: Arvid Norlander Date: Sat, 19 May 2007 16:47:52 +0000 (+0000) Subject: Fixed a bug in the png_recompress.sh script X-Git-Url: https://git.octo.it/?p=supertux.git;a=commitdiff_plain;h=50b09a4d69d87a94cd8ac607946d335a2452698f Fixed a bug in the png_recompress.sh script SVN-Revision: 5004 --- diff --git a/tools/png_recompress.sh b/tools/png_recompress.sh index b38cb7d08..f515536a3 100755 --- a/tools/png_recompress.sh +++ b/tools/png_recompress.sh @@ -66,7 +66,7 @@ for image in "$@"; do echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')" newsize="$(pngcrush -reduce -brute -d "$TMPPATH" "$image" | grep -E "filesize reduction")" echo "$newsize" - if [[ $newsize =~ ".+reduction.+" ]]; then + if grep -q reduction <<< "$newsize"; then cp -v "${TMPPATH}/$fname" "$dname/$fname" else rm -v "${TMPPATH}/$fname" @@ -83,7 +83,7 @@ for image in "$@"; do echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')" newsize="$(optipng -i 0 -o 7 -dir "$TMPPATH" "$image" | grep -E '^Output file size')" echo "$newsize" - if [[ $newsize =~ ".+decrease.+" ]]; then + if grep -q decrease <<< "$newsize"; then cp -v "${TMPPATH}/$fname" "$dname/$fname" else rm -v "${TMPPATH}/$fname"