From f2af2739786f43aeb099f0dac79634a1a9a68a0c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:23:10 +0000 Subject: [PATCH] fix: ensure summary is always displayed by properly capturing and displaying output Co-Authored-By: zfields@blues.com --- scripts/run_cppcheck.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/run_cppcheck.sh b/scripts/run_cppcheck.sh index 8de4f7a3..17a69f5c 100755 --- a/scripts/run_cppcheck.sh +++ b/scripts/run_cppcheck.sh @@ -52,8 +52,9 @@ generate_summary() { } | tee summary.txt } -# Run cppcheck and capture output to temporary file -cppcheck \ +# Run cppcheck and capture output +exec 5>&1 +CPPCHECK_OUTPUT=$(cppcheck \ --enable=all \ --check-level=exhaustive \ --inconclusive \ @@ -75,11 +76,11 @@ cppcheck \ --check-library \ --debug-warnings \ --error-exitcode=1 \ - . > cppcheck_output.txt 2>&1 + . 2>&1) CPPCHECK_EXIT_CODE=$? -# Display cppcheck output -cat cppcheck_output.txt +# Save output to file and display it +echo "$CPPCHECK_OUTPUT" | tee cppcheck_output.txt echo echo "=== Static Analysis Summary ==="