mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 16:41:41 +02:00
Fix return setting last exit code (#14120)
# Description Fixes #14113 and #14112. # Tests + Formatting Added a test.
This commit is contained in:
@ -104,7 +104,7 @@ pub(crate) fn run_commands(
|
||||
|
||||
if let Err(err) = result {
|
||||
report_shell_error(engine_state, &err);
|
||||
std::process::exit(err.exit_code());
|
||||
std::process::exit(err.exit_code().unwrap_or(0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ pub(crate) fn run_file(
|
||||
|
||||
if let Err(err) = result {
|
||||
report_shell_error(engine_state, &err);
|
||||
std::process::exit(err.exit_code());
|
||||
std::process::exit(err.exit_code().unwrap_or(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user