Make autocd return exit code 0 (#12337)

# Description
resolves #11159.

```
~/CodingProjects/nushell> ^false                               
~/CodingProjects/nushell> $env.LAST_EXIT_CODE                         
1
~/CodingProjects/nushell> ^false                                  
~/CodingProjects/nushell> ./crates/          
~/CodingProjects/nushell/crates> $env.LAST_EXIT_CODE
0                                              
```

# User-Facing Changes

autocd now sets exit code to 0.
This commit is contained in:
pwygab 2024-03-30 22:09:34 +08:00 committed by GitHub
parent 251599c507
commit 9444020f26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -810,6 +810,7 @@ fn do_auto_cd(
"NUSHELL_LAST_SHELL".into(), "NUSHELL_LAST_SHELL".into(),
Value::int(last_shell as i64, span), Value::int(last_shell as i64, span),
); );
stack.add_env_var("LAST_EXIT_CODE".into(), Value::int(0, Span::unknown()));
} }
/// ///