Avoid bogus comparisons when linking fails

This avoids drowning RGBLINK's errors in a meaningless `diff` output
This commit is contained in:
ISSOtm
2024-08-23 02:45:53 +02:00
committed by Sylvie
parent 8286d9c462
commit 4ce6c9f4a5

View File

@@ -114,11 +114,14 @@ for i in *.asm; do
desired_binname=${i%.asm}.out.bin
if [ -f "$desired_binname" ]; then
"$RGBLINK" -o "$gb" "$o"
rom_size=$(printf %s $(wc -c <"$desired_binname"))
dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null
tryCmp "$desired_binname" "$output" gb
(( our_rc = our_rc || $? ))
if ! "$RGBLINK" -o "$gb" "$o"; then
echo "${bold}${red}\`$RGBLINK -o $gb $o\` failed!${rescolors}${resbold}"
else
rom_size=$(printf %s $(wc -c <"$desired_binname"))
dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null
tryCmp "$desired_binname" "$output" gb
(( our_rc = our_rc || $? ))
fi
fi
(( rc = rc || our_rc ))