timetrace
timetrace copied to clipboard
command `timetrace edit project <key>` does not rename file
Currently, when a user edits a project using timetrace edit project <key>
the text editor is opened so the user can change the key.
It seems to me that any subsequent calls to this command should reference the new key, but trying to run this command this way causes the file to not be found.
Since some functions like project.LoadProject assume that the key will be part of the path, it seems like this command should also rename the json file with the new key.
Good point, thanks. There are two solutions:
- Automatically rename the file to the key after editing the record.
- Introduce a
--rename
flag explicitly for renaming projects and changing the filename there.
@aligator PTAL
I also see that It does not update old records.
What I expected when I renamed a project, everything else would be renamed to use that new project, but when I list old records, It does still show old project name.
@dominikbraun I'd like to handle this issue, can you assign this to me?
Also, can you think of a more optimal way of renaming the projects on the records, aside from looping through each date folder and .json file?
Also, can you think of a more optimal way of renaming the projects on the records, aside from looping through each date folder and .json file?
Unfortunately not... 🤔 @aligator?
- Could we add something like an "index" file for each project where all files are listed that are part of the project?
- It would be easier if the files would use an ID instead of the project name.
Was your intention that the files are human readable? Or doesn't that matter?
Was your intention that the files are human readable? Or doesn't that matter?
If I'm not missing something, it doesn't really matter. My suggestion would be to implement it as @joshuaherrera said, find a well-designed solution in the meantime and then migrate to that solution in a later release.
My suggestion would be to implement it as @joshuaherrera said, find a well-designed solution in the meantime and then migrate to that solution in a later release.
So my solution to this can be found in #156.