Data overwritten when --filename is not specified
rajuashok opened this issue · comments
I just installed friends and I can't seem to add any friends. Or at least the list friends command is failing. I see that the friends.md file is in fact updated, but when I run friends list friends nothing shows up. Any idea why?
Thanks for the cool project!
Actually I'm also seeing that everytime I add a friend the previous one is being overwritten. So there's only ever one friend in the .md file.
Thanks for opening an issue, @rajuashok! Sorry you've been running into problems. Can you tell me how you're adding friends? Are you using add friend
like so:
friends add friend Ashok Raju
or adding new friends directly via activities, like:
friends add activity 'My name is **Ashok Raju**.'
or editing the friends.md
file directly? Or something else?
I can't seem to reproduce what you're seeing so any information you can give me would be really helpful. Thanks!
Thanks for looking into this! Hope this helps.
Here's exactly what I'm doing:
friends add friend Ashok Raju
output: Friend added: "Ashok Raju"
cat friends.md
output:
### Activities:
### Notes:
### Friends:
- Ashok Raju
### Locations:
friends add friend Jacob E
output: Friend added: "Jacob E"
cat friends.md
output:
### Activities:
### Notes:
### Friends:
- Jacob E
### Locations:
friends list friends
output: No output
I'm also running into this issue, but I noticed it when I tried to add an activity. Here are some commands I've typed in, and then whats in friends.md
.
I'll do a friends add friend Peter
### Activities:
### Notes:
### Friends:
- Peter
### Locations:
friends add activity
> then I'll just type some text like Hung out with Peter
### Activities:
- 2019-01-25: Hung out with Peter
### Notes:
### Friends:
### Locations:
Also, FWIW when I did a friends clean
and it erased everything
### Activities:
### Notes:
### Friends:
### Locations:
Yikes! That's a pretty bad bug! 😬
Thanks for all the details @rajuashok and @pwalker. I figured out the issue—it looks like I introduced a regression in version 0.44
when I changed the default file location from ./friends.md
to ~/friends.md
. I should be able to get a fix out in the next few hours, but I want to make sure I add a test to prevent the same regression in the future so it could take a bit. In the meantime, I think it should work for you if you explicitly pass the filename like:
friends --filename ~/friends.md add friend Jacob Evelyn
But I'll let you know when a real fix is out soon! Thanks again for filing this bug report.
@rajuashok @pwalker this is now fixed in v0.46
! Simply run friends update
to get it.
Sorry for the scary bug, and thanks again for all the detail in your bug report!