mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 02:56:00 +02:00
make stderr works for failed external command (#11914)
# Description Fixes: #11913 When running external command, nushell shouldn't consumes stderr messages, if user want to redirect stderr. # User-Facing Changes NaN # Tests + Formatting Done # After Submitting NaN
This commit is contained in:
@@ -269,6 +269,7 @@ fn main() -> Result<()> {
|
||||
match testbin.item.as_str() {
|
||||
"echo_env" => test_bins::echo_env(true),
|
||||
"echo_env_stderr" => test_bins::echo_env(false),
|
||||
"echo_env_stderr_fail" => test_bins::echo_env_and_fail(false),
|
||||
"echo_env_mixed" => test_bins::echo_env_mixed(),
|
||||
"cococo" => test_bins::cococo(),
|
||||
"meow" => test_bins::meow(),
|
||||
|
@@ -16,6 +16,11 @@ pub fn echo_env(to_stdout: bool) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn echo_env_and_fail(to_stdout: bool) {
|
||||
echo_env(to_stdout);
|
||||
fail();
|
||||
}
|
||||
|
||||
fn echo_one_env(arg: &str, to_stdout: bool) {
|
||||
if let Ok(v) = std::env::var(arg) {
|
||||
if to_stdout {
|
||||
|
Reference in New Issue
Block a user