Revert "Pipeline operators: && and ||" (#7452)

Reverts nushell/nushell#7448

Some surprising behavior in how we do this. For example:

```
〉if (true || false) { print "yes!" } else { print "no!" }
no!
〉if (true or false) { print "yes!" } else { print "no!" }
yes!
```

This means for folks who are using the old `||`, they possibly get the
wrong answer once they upgrade. I don't think we can ship with that as
it will catch too many people by surprise and just make it easier to
write buggy code.
This commit is contained in:
JT
2022-12-13 16:36:13 +13:00
committed by GitHub
parent b7a3e5989d
commit 0c656fd276
12 changed files with 180 additions and 321 deletions

View File

@ -113,13 +113,6 @@ impl Stack {
.ok_or_else(|| ShellError::NushellFailed("No active overlay".into()))
}
pub fn last_exit_code(&self, engine_state: &EngineState) -> Option<i64> {
match self.get_env_var(engine_state, "LAST_EXIT_CODE") {
Some(Value::Int { val, .. }) => Some(val),
_ => None,
}
}
pub fn captures_to_stack(&self, captures: &HashMap<VarId, Value>) -> Stack {
// FIXME: this is probably slow
let mut env_vars = self.env_vars.clone();