Merge pull request #193 from element-hq/gaelg/ct-lint-error

ct-lint: fix errors were not catched
This commit is contained in:
Gaël Goinvic authored and GitHub committed 2025-02-17 10:32:02 +01:00
commit 3569002ce9
2 files changed
+10 -7

No files matched your search

File renamed without changes.
+10 -7
View File
@@ -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