Blame SOURCES/0069-shellcheck-Check-exit-code-directly-with-if-mycmd.patch

8e2d79
From 58d1e4fa0a0f6fc2fc3ee773665de70a073ae759 Mon Sep 17 00:00:00 2001
8e2d79
From: Martin Kutlak <mkutlak@redhat.com>
8e2d79
Date: Wed, 12 Dec 2018 16:16:55 +0100
8e2d79
Subject: [PATCH] shellcheck: Check exit code directly with if mycmd
8e2d79
8e2d79
Running a command and then checking its exit status $? against 0 is redundant.
8e2d79
8e2d79
Fixes ShellCheck warning SC2181.
8e2d79
8e2d79
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
8e2d79
---
8e2d79
 src/plugins/abrt-action-analyze-ccpp-local.in | 8 +++-----
8e2d79
 1 file changed, 3 insertions(+), 5 deletions(-)
8e2d79
8e2d79
diff --git a/src/plugins/abrt-action-analyze-ccpp-local.in b/src/plugins/abrt-action-analyze-ccpp-local.in
8e2d79
index 9144c0e6..d2453c19 100644
8e2d79
--- a/src/plugins/abrt-action-analyze-ccpp-local.in
8e2d79
+++ b/src/plugins/abrt-action-analyze-ccpp-local.in
8e2d79
@@ -36,9 +36,7 @@ if $INSTALL_DI; then
8e2d79
         fi
8e2d79
     done
8e2d79
 
8e2d79
-    ${EXECUTABLE} ${EXTRA_ARGS} --size_mb=4096
8e2d79
-fi
8e2d79
-
8e2d79
-if [ $? = 0 ]; then
8e2d79
-    abrt-action-generate-backtrace && abrt-action-analyze-backtrace
8e2d79
+   if ${EXECUTABLE} "${EXTRA_ARGS}" --size_mb=4096; then
8e2d79
+       abrt-action-generate-backtrace && abrt-action-analyze-backtrace
8e2d79
+   fi
8e2d79
 fi
8e2d79
-- 
8e2d79
2.26.2
8e2d79