mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Preserve metadata in more places (#12848)
# Description This PR makes some commands and areas of code preserve pipeline metadata. This is in an attempt to make the issue described in #12599 and #9456 less likely to occur. That is, reading and writing to the same file in a pipeline will result in an empty file. Since we preserve metadata in more places now, there will be a higher chance that we successfully detect this error case and abort the pipeline.
This commit is contained in:
@ -322,7 +322,9 @@ fn saving_to_source_file_error(dest: &Spanned<PathBuf>) -> ShellError {
|
||||
dest.item.display()
|
||||
),
|
||||
span: Some(dest.span),
|
||||
help: Some("You should use `collect` to run your save command (see `help collect`). Or, you can put the file data in a variable and then pass the variable to `save`.".into()),
|
||||
help: Some(
|
||||
"insert a `collect` command in the pipeline before `save` (see `help collect`).".into(),
|
||||
),
|
||||
inner: vec![],
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user