From 85d5bd6ddfc8dbdfeec361f200b6c013e736d0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Mon, 17 Feb 2025 10:06:46 +0100 Subject: [PATCH] ct-lint: fix errors were not catched --- .../{187.internal.md => 193.internal.md} | 0 scripts/ct-lint.sh | 17 ++++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) rename newsfragments/{187.internal.md => 193.internal.md} (100%) diff --git a/newsfragments/187.internal.md b/newsfragments/193.internal.md similarity index 100% rename from newsfragments/187.internal.md rename to newsfragments/193.internal.md diff --git a/scripts/ct-lint.sh b/scripts/ct-lint.sh index a8f40f0f..d18ea045 100644 --- a/scripts/ct-lint.sh +++ b/scripts/ct-lint.sh @@ -4,17 +4,20 @@ # # SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial +set -euo pipefail temp_output_file=$(mktemp) -# Call the ct lint command and stream the output to stdout -ct lint "$@" 2>&1 | tee "$temp_output_file" - error=1 -# Check if there are any "[INFO] Fail:" lines in the output -(grep -q '\[INFO\] Fail:' "$temp_output_file") || \ -(grep -q '\[INFO\] Missing required value:' "$temp_output_file") ||\ -error=0 + +# Call the ct lint command and stream the output to stdout +if ct lint "$@" 2>&1 | tee "$temp_output_file" +then + # Check if there are any "[INFO] Fail:" lines in the output + (grep -q '\[INFO\] Fail:' "$temp_output_file") || \ + (grep -q '\[INFO\] Missing required value:' "$temp_output_file") ||\ + error=0 +fi if [ "$error" -eq 1 ]; then # If found, exit with status code 1