From 05e27afcb450d13bc4ab9ba1bb56df77bbad9f91 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Tue, 10 Feb 2026 15:01:35 -0500 Subject: [PATCH] fix: Call aggregate_results in main shell after pipeline The pipe into validate_examples_parallel creates a subshell, so TOTAL_VALIDATED and TOTAL_FAILED set inside it are lost. Now we call aggregate_results again in the main shell after the pipeline completes to properly count the results from the JSON files. --- scripts/validate-examples.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/validate-examples.sh b/scripts/validate-examples.sh index 0379e81..54428a4 100755 --- a/scripts/validate-examples.sh +++ b/scripts/validate-examples.sh @@ -689,8 +689,11 @@ main() { TOTAL_EXAMPLES=$(echo "$examples" | wc -l) log "Found $TOTAL_EXAMPLES example files" - # Validate examples + # Validate examples (runs in subshell due to pipe) echo "$examples" | validate_examples_parallel + + # Re-aggregate in main shell (subshell variables don't propagate) + aggregate_results fi # Generate reports