Run shellcheck over check_dilate.sh

This commit is contained in:
def 2020-12-02 09:57:25 +01:00
parent 56a90c25ec
commit 1dcc1e4026

View file

@ -4,24 +4,24 @@ result=
dil_path=$1
result=$(find $2 -iname '*.png' -print0 | while IFS= read -r -d $'\0' file; do
result=$(find "$2" -iname '*.png' -print0 | while IFS= read -r -d $'\0' file; do
new_file=$(mktemp --tmpdir "$(basename "$file" .png).XXX.png")
cp "$file" "$new_file"
convert "$new_file" "${new_file}_old.bmp" >> /dev/null
${dil_path}/dilate "$new_file" >> /dev/null
convert "$new_file" "${new_file}_new.bmp" >> /dev/null
convert "$new_file" "${new_file}_old.bmp" > /dev/null
"${dil_path}"/dilate "$new_file" > /dev/null
convert "$new_file" "${new_file}_new.bmp" > /dev/null
orig_hash=$(identify -quiet -format "%#" "${new_file}_old.bmp")
new_hash=$(identify -quiet -format "%#" "${new_file}_new.bmp")
rm "$new_file"
rm "${new_file}_old.bmp"
rm "${new_file}_new.bmp"
if [ "$orig_hash" != "$new_hash" ]; then
printf "$file is not dilated\n"
echo "$file is not dilated"
fi
done)
if [[ "$result" != "" ]]; then
printf "$result"
echo -n "$result"
exit 1
fi