Fix do -p not waiting for external commands (#13881)

# Description
Similar to #13870 (thanks @WindSoilder), this PR adds a boolean which
determines whether to ignore any errors from an external command. This
is in order to fix #13876. I.e., `do -p` does not wait for externals to
complete before continuing.

# User-Facing Changes
Bug fix.

# Tests + Formatting
Added a test.
This commit is contained in:
Ian Manske
2024-09-22 07:26:32 -07:00
committed by GitHub
parent cf5fec63c0
commit cd0d0364ec
4 changed files with 25 additions and 9 deletions

View File

@ -73,3 +73,10 @@ fn run_closure_with_it_using() {
assert!(actual.err.is_empty());
assert_eq!(actual.out, "3");
}
#[test]
fn waits_for_external() {
let actual = nu!(r#"do -p { nu -c 'sleep 1sec; print before; exit 1'}; print after"#);
assert!(actual.err.is_empty());
assert_eq!(actual.out, "beforeafter");
}