mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:45:41 +02:00
save --append: create file if it doesn't exist (#4156)
* have save --append create file if not exists Currently, doing: echo a | save --raw --append file.txt will fail if file.txt does not exist. This PR changes that * test that `save --append` will create new file
This commit is contained in:
committed by
GitHub
parent
91c270c14a
commit
fb197f562a
@ -884,7 +884,7 @@ impl Shell for FilesystemShell {
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let mut options = OpenOptions::new();
|
||||
if append {
|
||||
options.append(true)
|
||||
options.append(true).create(true)
|
||||
} else {
|
||||
options.write(true).create(true).truncate(true)
|
||||
};
|
||||
|
Reference in New Issue
Block a user