From 8164b742f984097ec9e32c4239a160d7fecdd727 Mon Sep 17 00:00:00 2001
From: RJ Trujillo <eyecantcu@pm.me>
Date: Fri, 22 Dec 2023 15:20:31 -0700
Subject: [PATCH] feat: Lint all RPM files before exiting due to failure

---
 rpmlint.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/rpmlint.sh b/rpmlint.sh
index fffc81a..efe5071 100755
--- a/rpmlint.sh
+++ b/rpmlint.sh
@@ -22,9 +22,15 @@ ARGUMENTS=$(echo "$ARGUMENTS" | xargs)
 
 # Perform rpmlint on comma-separated list of files
 if [[ -n "${RPMFILES}" ]]; then
+  RETURN_CODE=0
+  RPMLINT_STATUS=0
   for FILE in $(echo "${RPMFILES}" | tr "," "\n"); do
-    rpmlint $ARGUMENTS $FILE
+    rpmlint "$ARGUMENTS" "$FILE" || RPMLINT_STATUS=$?
+    if [[ $RPMLINT_STATUS -ne 0 ]]; then
+      RETURN_CODE=$RPMLNT_STATUS
+    fi
   done
+  exit $RETURN_CODE
 else
-  rpmlint $ARGUMENTS
+  rpmlint "$ARGUMENTS"
 fi