zenhob / hcl

Command-line tool for manipulating Harvest timesheets
http://zenhob.github.io/hcl
MIT License
223 stars 45 forks source link

Features/clear cache #95

Open lewis-fidlers opened 5 years ago

lewis-fidlers commented 5 years ago

Hi,

this aims to solve #71

summary

It introduces a command to delete cache, as this is the easy approach to solve the issue.

Also takes a shot at (minimalistic) keeping the cache up to date by checking when the file has last been updated. Actual comparison of tasks would be a cleaner solution but would also be a lot more complex.

additions

hcl delete_cache

This will remove the cache file

hcl refresh_cache

This will rebuild the cache file if it has not been changed in the last 24 hours.

changes

running hcl tasks will now run refresh_cache When a cache is available. If the cache has not been updated for over 24 hours it will rebuild it.