sd
sd copied to clipboard
Add option to modify files in-place
# in /srv/our-board/
$ sd foo bar test.txt
Error processing .env: Permission denied (os error 13) at path "/srv/our-board/.tmp4oOZn4"
Would love it if:
- it would exit with a code > 0
- if there was a flag (or the default) to not need a tmp file at all (as I don't have write access to the directory
The first part should already be handled by #186
Also for the second part I don't think it would be good as the default (although I'd be open to having a flag to configure)
It's writing to a temp file and then renaming things to handle atomic file writing. Writing to the file in-place can lead to issues where an operation was only able to partially complete (the machine may power off before finishing for instance)