From 1bc10a9d9c5a3dd60915948253fc21330f976490 Mon Sep 17 00:00:00 2001 From: Marek Kulik Date: Thu, 10 Oct 2024 17:57:29 +0200 Subject: [PATCH] Try alternative to xargs in validate.sh --- tools/validate.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/validate.sh b/tools/validate.sh index 6fcc70d..d14d7cb 100644 --- a/tools/validate.sh +++ b/tools/validate.sh @@ -1,3 +1,13 @@ #!/bin/bash -find 'functions/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/function.yaml {} +exit_code=0 + +find 'functions/' -name "*.yaml" -type f | while read -r file; do + tools/yajsv -s schemas/function.yaml "$file" + + if [ $? -ne 0 ]; then + exit_code=1 + fi +done + +exit $exit_code