ysf / anewer

anewer appends lines from stdin to a file if they don't already exist in the file. This is a rust version of https://github.com/tomnomnom/anew
https://github.com/ysf/anewer
GNU General Public License v3.0
57 stars 4 forks source link

Don't error if anewer file doesn't exist yet #6

Closed kpcyrd closed 2 years ago

kpcyrd commented 3 years ago

Resolves #5

Also fixes a bug with empty anewer files:

# Before
% rm foo.txt; touch foo.txt; echo x | cargo run foo.txt; cat foo.txt
x

x
# After
% rm foo.txt; touch foo.txt; echo x | cargo run foo.txt; cat foo.txt
x
x
%
nil0x42 commented 3 years ago

looks good to me !