From 76d3b6eaa20174d3ab4b222bf4186014556839a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 29 Jan 2023 13:41:41 +0100 Subject: [PATCH] use another for each method and check for device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Küthe --- test.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test.sh b/test.sh index 346c1cd..4cf6a13 100755 --- a/test.sh +++ b/test.sh @@ -8,16 +8,16 @@ if ! jq --version &> /dev/null; then fi ret=0 -while read -r l -do - if ! jq --exit-status '.route | .[] | .description' < "$l" > /dev/null 2>&1 + +for file in *.json; do + if ! jq --exit-status '.route | .[] | .device' < "$file" > /dev/null 2>&1 then - echo "$l is invalid." >&2 + echo "$file is invalid." >&2 ret=1 else - #echo "$l is valid." + #echo "$file is valid." : fi -done < <(find "$PWD" -name '*.json' -type f) +done exit $ret