From dfe89febaa5771474802ada261ba89a5eb003456 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:14:59 -0700 Subject: [PATCH] Bug fixes in bin/find-invalid-json.sh It incorrectly calculated the number of invalid JSON files. Redirect jparse stderr to /dev/null as the script will be able to tell without the extra clutter. --- bin/find-invalid-json.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/find-invalid-json.sh b/bin/find-invalid-json.sh index 913ddd013..024c67daf 100755 --- a/bin/find-invalid-json.sh +++ b/bin/find-invalid-json.sh @@ -207,7 +207,7 @@ find . -name '*.json' -print | # get name of each JSON file while read -r JSON_FILE; do # try parsing JSON file - if ! "$JPARSE" "$JSON_FILE"; then + if ! "$JPARSE" "$JSON_FILE" 2>/dev/null; then echo "$JSON_FILE is invalid JSON" fi # this writes the invalid JSON files to the temporary error file @@ -217,7 +217,6 @@ done > "$TMP_INVALID_JSON" # INVALID_JSON_COUNT=$(wc -l < "$TMP_INVALID_JSON" | tr -d ' ') export INVALID_JSON_COUNT -((INVALID_JSON_COUNT=INVALID_JSON_COUNT/4)) # report on any invalid JSON files