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.
This commit is contained in:
russell@unturf.com 2026-02-10 15:01:35 -05:00
parent a2927a3f6b
commit 05e27afcb4

View file

@ -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