8000 closes #14: added func returning init dir for empty records dir by KonstantinGasser · Pull Request #18 · dominikbraun/timetrace · GitHub
[go: up one dir, main page]

Skip to content

closes #14: added func returning init dir for empty records dir - #18

Merged
dominikbraun merged 2 commits into
dominikbraun:mainfrom
KonstantinGasser:#14-status-issue-empty-records
May 16, 2021
Merged

dominikbraun merged 2 commits into
dominikbraun:mainfrom
KonstantinGasser:#14-status-issue-empty-records

Conversation

@KonstantinGasser
Copy link
Copy Markdown

As stated in the issue I added a func returning the init dir for the empty records directory and appended the slice in fs.EnsureDirectories accordingly. func recordsInitSubDir returns ~/.timetrace/records/YYYY-MM-DD. cmd timetrace status exists now with ErrTrackingNotStarted instead of with the err from ioutil.ReadDir.

KonstantinGasser added 2 commits May 15, 2021 23:56
…eturns the init dir for t

oday for the records dir (~/.timetrace/records/YYYY-MM-DD) and appended the slice in fs.EnsureDirectories accordingly.
ssuse of RecordDirFromDate causing creation of user home dir in records dir. removing filepath.Join and only returning fs.RecordDirFromDate(time.Now()) now correctly returns the init path for an empty record with a sub dir in the form of YYYY-MM-DD
@KonstantinGasser
KonstantinGasser commented May 15, 2021 •
Copy link
Copy Markdown
Author

in the first PR is overlooked the fact that fs.RecordDirFromDate already creates a full path of ~/.timetrace/records/YYYY-MM-DD. I have removed the filepath.Join in recordsInitSubDir since the RecordDIrFromDate does already join rootDir with recordsDir.

@dominikbraun
dominikbraun self-requested a review May 16, 2021 06:25
@dominikbraun dominikbraun left a comment
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Exactly, RecordDirFromDate returns the path for a record directory with the provided date. LGTM, thanks! 👍

@dominikbraun
dominikbraun merged commit 9550c77 into dominikbraun:main May 16, 2021
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.

2 participants

0