To achieve this, I've replaced the flate2 crate with the zip crate, and have changed the download URL accordingly. Also, instead of wiping the entire cache dir, I've made Cache::clear() only delete directories that are known to contain a tldr-pages archive, i.e. tldr-master (the old dir) and tldr-pages (the new dir). In the future, we could/should drop the part which deals with the old directory.
This PR also includes changes from @dbrgn's cache refactoring branch.
According to the tldr client specifications, downloading https://tldr.sh/assets/tldr.zip is preferred over directly downloading an archive of the master branch.
To achieve this, I've replaced the flate2 crate with the zip crate, and have changed the download URL accordingly. Also, instead of wiping the entire cache dir, I've made
Cache::clear()
only delete directories that are known to contain a tldr-pages archive, i.e.tldr-master
(the old dir) andtldr-pages
(the new dir). In the future, we could/should drop the part which deals with the old directory.This PR also includes changes from @dbrgn's cache refactoring branch.