Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue with attempting to load data from an empty directory #96

Merged
merged 2 commits into from
Jun 2, 2021

Conversation

joshuaherrera
Copy link
Contributor

Resolves issue #95 by checking that the latest directory contains at least 1 file.

Copy link
Owner

@dominikbraun dominikbraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution! Maybe we'll extend the Filesystem interface later and add a function like LatestRecordDirPath so we can move this filesystem-related logic into the fs package.

Otherwise, I just have a small suggestion 😄

core/record.go Outdated Show resolved Hide resolved
Co-authored-by: Dominik Braun <mail@dominikbraun.io>
@joshuaherrera
Copy link
Contributor Author

joshuaherrera commented Jun 1, 2021

That change looks good, I just committed your suggestion.

Maybe we'll extend the Filesystem interface later and add a function like LatestRecordDirPath so we can move this filesystem-related logic into the fs package.

Yes, I wasn't sure where the best place to put these helper functions would be, so I put them in the timetrace.go file. I like this idea better though.

Copy link
Owner

@dominikbraun dominikbraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@dominikbraun dominikbraun merged commit 2f9b89c into dominikbraun:main Jun 2, 2021
@dominikbraun
Copy link
Owner

This fix is contained in release 0.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command timetrace edit record latest panics if the user has no records logged for today
2 participants