mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:25:43 +02:00
Fix try
printing when it is not the last pipeline element (#13992)
# Description Fixes #13991. This was done by more clearly separating the case when a pipeline is drained vs when it is being written (to a file). I also added an `OutDest::Print` case which might not be strictly necessary, but is a helpful addition. # User-Facing Changes Bug fix. # Tests + Formatting Added a test. # After Submitting There are still a few redirection bugs that I found, but they require larger code changes, so I'll leave them until after the release.
This commit is contained in:
@ -163,7 +163,7 @@ use it in your pipeline."#
|
||||
Ok(None)
|
||||
}
|
||||
OutDest::Null => copy_on_thread(tee, io::sink(), &info).map(Some),
|
||||
OutDest::Inherit => {
|
||||
OutDest::Print | OutDest::Inherit => {
|
||||
copy_on_thread(tee, io::stderr(), &info).map(Some)
|
||||
}
|
||||
OutDest::File(file) => {
|
||||
@ -181,7 +181,9 @@ use it in your pipeline."#
|
||||
Ok(())
|
||||
}
|
||||
OutDest::Null => copy_pipe(stdout, io::sink(), &info),
|
||||
OutDest::Inherit => copy_pipe(stdout, io::stdout(), &info),
|
||||
OutDest::Print | OutDest::Inherit => {
|
||||
copy_pipe(stdout, io::stdout(), &info)
|
||||
}
|
||||
OutDest::File(file) => copy_pipe(stdout, file.as_ref(), &info),
|
||||
}?;
|
||||
}
|
||||
@ -198,7 +200,7 @@ use it in your pipeline."#
|
||||
OutDest::Null => {
|
||||
copy_pipe_on_thread(stderr, io::sink(), &info).map(Some)
|
||||
}
|
||||
OutDest::Inherit => {
|
||||
OutDest::Print | OutDest::Inherit => {
|
||||
copy_pipe_on_thread(stderr, io::stderr(), &info).map(Some)
|
||||
}
|
||||
OutDest::File(file) => {
|
||||
@ -218,7 +220,7 @@ use it in your pipeline."#
|
||||
Ok(())
|
||||
}
|
||||
OutDest::Null => copy(tee, io::sink(), &info),
|
||||
OutDest::Inherit => copy(tee, io::stdout(), &info),
|
||||
OutDest::Print | OutDest::Inherit => copy(tee, io::stdout(), &info),
|
||||
OutDest::File(file) => copy(tee, file.as_ref(), &info),
|
||||
}?;
|
||||
}
|
||||
|
Reference in New Issue
Block a user