diff --git a/examples/conditionals.ion b/examples/conditionals.ion new file mode 100644 index 0000000000000000000000000000000000000000..46c1b24b080d4590342046e84a82544e735f0945 --- /dev/null +++ b/examples/conditionals.ion @@ -0,0 +1,9 @@ +true && echo and || echo or +false && echo and || echo or +false || echo false +true && echo true +true || echo cant get here +false && echo cant get here +false || false || echo double or +true && true && echo double and +false || true && echo or and diff --git a/examples/conditionals.out b/examples/conditionals.out new file mode 100644 index 0000000000000000000000000000000000000000..1bb8764d60849b3ea95b8a1b48d090f78a4c5107 --- /dev/null +++ b/examples/conditionals.out @@ -0,0 +1,7 @@ +and +or +false +true +double or +double and +or and diff --git a/src/shell/pipe.rs b/src/shell/pipe.rs index a76ffedf0e7eb4e121e5360f600f01ab2f5642f7..baf8375e886ade1444dad17f4d62c00745ed10a1 100644 --- a/src/shell/pipe.rs +++ b/src/shell/pipe.rs @@ -273,12 +273,10 @@ pub fn pipe ( match previous_kind { JobKind::And => if previous_status != SUCCESS { if let JobKind::Or = kind { previous_kind = kind } - commands.next(); continue }, JobKind::Or => if previous_status == SUCCESS { if let JobKind::And = kind { previous_kind = kind } - commands.next(); continue }, _ => ()