From 63c24ce5a773dd07b5a429c3d78abeafead09628 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 17 Jan 2019 14:27:19 -0800 Subject: [PATCH] improve robustness of image diffing script, even when intersection IDs change --- editor/compare_screencaps.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editor/compare_screencaps.sh b/editor/compare_screencaps.sh index d0ec112a35..b2386c106e 100755 --- a/editor/compare_screencaps.sh +++ b/editor/compare_screencaps.sh @@ -7,11 +7,15 @@ rm -rf diff mkdir diff for file in `ls $before | grep -v full.png | grep -v combine.sh`; do - diff $before/$file $after/$file; + # 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}*; if [ $? -eq 1 ]; then - compare $before/$file $after/$file diff/$file; + compare $before/${prefix}* $after/${prefix}* diff/${prefix}.png; if [ "$3" == "-i" ]; then - feh diff/$file $before/$file $after/$file; + feh diff/${prefix}.png $before/${prefix}* $after/${prefix}*; # Handle interrupts by killing the script entirely if [ $? -ne 0 ]; then exit;