File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -309,11 +309,23 @@ _parallelize () {
309
309
fi
310
310
# Call function with args and variables in background
311
311
# shellcheck disable=SC2016,SC2294
312
- { eval " $@ " $( seq -s' ' -f ' "$var%.0f"' " $n_vars " ) ; } &
312
+ {
313
+ eval " $@ " $( seq -s' ' -f ' "$var%.0f"' " $n_vars " )
314
+ } 1> " $PLAIN_REPO /_fd1" \
315
+ 2> " $PLAIN_REPO /_fd2" &
313
316
pids=" $pids $! "
317
+ mv " $PLAIN_REPO /_fd1" " $PLAIN_REPO /_fd1_$! "
318
+ mv " $PLAIN_REPO /_fd2" " $PLAIN_REPO /_fd2_$! "
314
319
done
315
320
# Wait on all spawned jobs; transferring their exit status to ours
316
- for pid in $pids ; do wait " $pid " ; done
321
+ status=0
322
+ for pid in $pids ; do
323
+ if ! wait " $pid " ; then status=1; fi
324
+ cat " $PLAIN_REPO /_fd1_$pid "
325
+ cat " $PLAIN_REPO /_fd2_$pid " >&2
326
+ done
327
+ rm " $PLAIN_REPO " /_fd* _*
328
+ if [ $status -ne 0 ]; then exit 1; fi
317
329
done
318
330
}
319
331
You can’t perform that action at this time.
0 commit comments