Bug in save
under certain circumstances
#12599
Labels
🐛 bug
Something isn't working
file-system
Related to commands and core nushell behavior around the file system
pipeline-metadata
Additional information passed along that is not directly attached to the values (e.g. LSCOLORS)
Describe the bug
This filter produces an incorrect output.
This filter is supposed to open a file, trim the whitespace and save the file again to the same path. This however instead deletes contents of the file. It seems that it is this particular combination of things. This filter for example works as expected.
This works as well (surprisingly)
and so does this (unsurprisingly)
So it seems to happen only if :
a.) it's a one liner
b.) you are overwriting the file
c.) you are are saving it as raw``
How to reproduce
1.) make file with some line endings
2.) define
3.) run
rtrim "file.md"
Expected behavior
The contents of the file should not be deleted.
Screenshots
No response
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: