The `&&` operator runs the next command only if the last one succeeded. Today you add your first conditional connector, the one behind every "build && test" you have ever typed.
Implement `&&` so the pipeline after it runs only when the previous pipeline's status was zero.
&& is a conditional connector: it runs the pipeline to its right only if
the pipeline to its left succeeded, meaning exited with status 0. It is how you
say “do this, and only if that worked, do the next thing” - mkdir build && cd build, make && make test. If the left side fails, the right side is skipped
entirely and the failure status carries forward.
Slot it into the connector loop from yesterday. Where ; always runs the next
pipeline, && consults the last status first and runs the next pipeline only
when it is zero. This “stop early on failure” behavior is called short-circuit
evaluation, and it is the same idea as && in most programming languages -
except here each operand is a whole command whose success is its exit status.
// after running the left pipeline, check last_status before the right onerun_pipeline(left);if (connector == AND && last_status == 0)run_pipeline(right); // only on success