mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 08:05:44 +00:00
fix(bash): correctly propagate exit errors
This commit is contained in:
@@ -89,8 +89,18 @@ cat bp | tail -1 >> ./result2.out &
|
||||
# Run main.sh in the same process group
|
||||
{bash} ./main.sh "$@" 2>&1 | tee bp &
|
||||
|
||||
# Wait for all background processes to finish
|
||||
wait
|
||||
pid=$!
|
||||
|
||||
# Wait for main.sh to finish and capture its exit status
|
||||
wait $pid
|
||||
exit_status=$?
|
||||
|
||||
# Clean up the named pipe and background processes
|
||||
rm -f bp
|
||||
|
||||
|
||||
# Exit with the captured status
|
||||
exit $exit_status
|
||||
"#,
|
||||
bash = BIN_BASH.as_str(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user