shellcheck: Fix SC2143
SC2143 (style): Use ! grep -q instead of comparing output with
[ -z .. ].
Not a bug.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240406123833.406488-8-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 42cc27a..f8aa5da 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -61,7 +61,11 @@
# Even when ret==1 (unittest success) if we also got stderr
# logs, then we assume a QEMU failure. Otherwise we translate
# status of 1 to 0 (SUCCESS)
- if [ -z "$(echo "$errors" | grep -vi warning)" ]; then
+ if [ "$errors" ]; then
+ if ! grep -qvi warning <<<"$errors" ; then
+ ret=0
+ fi
+ else
ret=0
fi
fi