abstreet/editor/compare_screencaps.sh

26 lines
628 B
Bash
Raw Normal View History

2019-01-15 20:41:45 +03:00
#!/bin/bash
before=$1;
after=$2;
rm -rf diff
mkdir diff
for file in `ls $before | grep -v full.png | grep -v combine.sh`; do
# For whatever reason, the intersection annotation doesn't seem to
# always match up between two captures.
prefix=`echo $file | sed 's/_.*//' | sed 's/.png//'`;
diff $before/${prefix}* $after/${prefix}*;
2019-01-15 20:41:45 +03:00
if [ $? -eq 1 ]; then
compare $before/${prefix}* $after/${prefix}* diff/${prefix}.png;
2019-01-15 20:41:45 +03:00
if [ "$3" == "-i" ]; then
feh diff/${prefix}.png $before/${prefix}* $after/${prefix}*;
# Handle interrupts by killing the script entirely
if [ $? -ne 0 ]; then
exit;
fi
2019-01-15 20:41:45 +03:00
fi
fi
done