mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 18:03:51 +01:00
Fix file redirection for externals streams (#12321)
# Description Fixes `open --raw file o> out.txt` and other instances where `PipelineData::ExternalStream` is created from sources that are not external commands.
This commit is contained in:
parent
442faa5576
commit
8e763a2fd6
@ -438,12 +438,12 @@ fn eval_element_with_input_inner<D: DebugContext>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = match (data, stack.pipe_stdout()) {
|
let data = if matches!(stack.pipe_stdout(), Some(IoStream::File(_)))
|
||||||
(
|
&& !matches!(stack.pipe_stderr(), Some(IoStream::Pipe))
|
||||||
data @ (PipelineData::Value(..) | PipelineData::ListStream(..)),
|
{
|
||||||
Some(IoStream::File(_)),
|
data.write_to_io_streams(engine_state, stack)?
|
||||||
) => data.write_to_io_streams(engine_state, stack)?,
|
} else {
|
||||||
(data, _) => data,
|
data
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok((data, ok))
|
Ok((data, ok))
|
||||||
|
Loading…
Reference in New Issue
Block a user