Abort if {montage,convert} fails as well

This commit is contained in:
est31 2016-01-17 18:11:14 +01:00
parent 14e314e1bc
commit 2efe27f0b0

View File

@ -64,7 +64,15 @@ do
for y in $(seq 0 $tnum) for y in $(seq 0 $tnum)
do do
montage $dirb/map_$(($x*2))_$((y*2)).png $dirb/map_$(($x*2+1))_$((y*2)).png $dirb/map_$(($x*2))_$((y*2+1)).png $dirb/map_$(($x*2+1))_$((y*2+1)).png -geometry +0+0 $dir/map_${x}_${y}.png montage $dirb/map_$(($x*2))_$((y*2)).png $dirb/map_$(($x*2+1))_$((y*2)).png $dirb/map_$(($x*2))_$((y*2+1)).png $dirb/map_$(($x*2+1))_$((y*2+1)).png -geometry +0+0 $dir/map_${x}_${y}.png
if [ $? -ne 0 ]; then
echo "montage exited with non zero exit code, aborting."
exit 1
fi
convert $dir/map_${x}_${y}.png -resize 50% $dir/map_${x}_${y}.png convert $dir/map_${x}_${y}.png -resize 50% $dir/map_${x}_${y}.png
if [ $? -ne 0 ]; then
echo "convert exited with non zero exit code, aborting."
exit 1
fi
done done
done done
done done