From 2efe27f0b0281fb2dea8ae9ba21d8d1df099c6f3 Mon Sep 17 00:00:00 2001 From: est31 Date: Sun, 17 Jan 2016 18:11:14 +0100 Subject: [PATCH] Abort if {montage,convert} fails as well --- mapper.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mapper.sh b/mapper.sh index adafe1a..af551ba 100755 --- a/mapper.sh +++ b/mapper.sh @@ -64,7 +64,15 @@ do for y in $(seq 0 $tnum) 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 + 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 + if [ $? -ne 0 ]; then + echo "convert exited with non zero exit code, aborting." + exit 1 + fi done done done