summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/state/history/builtins.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/state/history/builtins.rs b/src/state/history/builtins.rs
index e999035..fd5b5c1 100644
--- a/src/state/history/builtins.rs
+++ b/src/state/history/builtins.rs
@@ -121,9 +121,10 @@ async fn and(
) -> async_std::process::ExitStatus {
let exe = exe.shift();
if env.latest_status().success() {
- super::run_exe(&exe, env).await;
+ super::run_exe(&exe, env).await
+ } else {
+ *env.latest_status()
}
- *env.latest_status()
}
async fn or(
@@ -131,10 +132,11 @@ async fn or(
env: &super::ProcessEnv,
) -> async_std::process::ExitStatus {
let exe = exe.shift();
- if !env.latest_status().success() {
- super::run_exe(&exe, env).await;
+ if env.latest_status().success() {
+ *env.latest_status()
+ } else {
+ super::run_exe(&exe, env).await
}
- *env.latest_status()
}
async fn command(