Move insertion of commas to a separate file

Create a separate function to insert the comma separators between findings for different tests within mass testing.
This commit is contained in:
David Cooper 2017-03-30 12:48:25 -04:00 committed by GitHub
parent d8a7037000
commit 9f93d9d578

View File

@ -956,6 +956,13 @@ fileout_banner() {
#fi
}
fileout_separator() {
if "$JSONHEADER"; then
"$do_pretty_json" && echo " ," >> "$JSONFILE"
"$do_json" && echo -n "," >> "$JSONFILE"
fi
}
fileout_footer() {
if "$JSONHEADER"; then
fileout_json_footer
@ -11847,10 +11854,7 @@ run_mass_testing() {
cmdline="$0 $global_cmdline --warnings=batch $cmdline"
draw_line "=" $((TERM_WIDTH / 2)); outln;
outln "$cmdline"
if ! "$first" && "$JSONHEADER"; then
"$do_pretty_json" && echo " ," >> "$JSONFILE"
"$do_json" && echo -n "," >> "$JSONFILE"
fi
"$first" || fileout_separator
CHILD_MASS_TESTING=true $cmdline
first=false
done < "${FNAME}"