diff options
Diffstat (limited to 'src/runner/mod.rs')
-rw-r--r-- | src/runner/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runner/mod.rs b/src/runner/mod.rs index 63af51b..84be9a1 100644 --- a/src/runner/mod.rs +++ b/src/runner/mod.rs @@ -107,12 +107,14 @@ async fn run_commands( stack.push(Frame::If(false)); } if should { + let status = env.latest_status(); run_pipeline(pipeline.clone(), env, shell_write).await?; if let Some(Frame::If(should)) = stack.top_mut() { *should = env.latest_status().success(); } else { unreachable!(); } + env.set_status(status); } pc += 1; } @@ -122,12 +124,14 @@ async fn run_commands( stack.push(Frame::While(false, pc)); } if should { + let status = env.latest_status(); run_pipeline(pipeline.clone(), env, shell_write).await?; if let Some(Frame::While(should, _)) = stack.top_mut() { *should = env.latest_status().success(); } else { unreachable!(); } + env.set_status(status); } pc += 1; } |