dominikbraun / timetrace

A simple CLI for tracking your working time.
Apache License 2.0
685 stars 76 forks source link

Command `timetrace edit record latest` panics if the user has no records logged for today #95

Closed joshuaherrera closed 3 years ago

joshuaherrera commented 3 years ago

Running timetrace edit record latest when a user has not logged any time today causes the program to panic, image attached. Note, I did have valid records from the day prior, so I imagine it should have grabbed the record from yesterday, but it looks like the code assumes the newest directory in ~/.timetrace/records will contain time logs. panic

dominikbraun commented 3 years ago

Which timetrace version do you have? For some reason, I don't get this error:

timetrace edit record latest     
💡 Opening 2021-06-01 09:11:42.542106 +0200 CEST in default editor
❗ Failed to edit project: record not found
joshuaherrera commented 3 years ago

@dominikbraun I had this error on version 0.7.0. Was your records directory for 06/01 empty?

dominikbraun commented 3 years ago

Nevermind, I think I tried to reproduce the error the wrong way - I didn't clean up the record directory but renamed it instead.