Some shell script style improvements (#2087)

* Escape special characters in filenames when comparing gfx .err output
* Use `if` instead of `&&`
* Use `case` instead of `if` disjunction

---------

Co-authored-by: Eldred Habert <[email protected]>
This commit is contained in:
Rangi
2026-09-21 10:15:40 -04:00
committed by GitHub
co-authored by Eldred Habert
parent 84c1671cb3
commit 04bbe80ae0
2 changed files with 23 additions and 14 deletions
+3 -3
View File
@@ -90,9 +90,9 @@ for i in *.asm notexist.asm; do
# "make-deps.asm" refers to its output filename in its desired output.
# "notexist.asm" doesn't exist, so there's no point in trying to `cat` it.
# Skip testing with stdin input for those files.
if [[ "$i" = include-recursion.asm || "$i" = make-deps.asm || "$i" = notexist.asm ]]; then
continue
fi
case "$i" in
include-recursion.asm | make-deps.asm | notexist.asm) continue;;
esac
# shellcheck disable=SC2002 # (This use of `cat` intentionally makes the input an unseekable pipe.)
cat "$i" | "$RGBASM" "${RGBASMFLAGS[@]}" -o "$o" - >"$output" 2>"$errput"