tealdeer-rs / tealdeer

A very fast implementation of tldr in Rust.
https://tealdeer-rs.github.io/tealdeer/
Apache License 2.0
4.17k stars 123 forks source link

chore: download proper tldr archive #213

Closed invakid404 closed 2 years ago

invakid404 commented 2 years ago

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) 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.

dbrgn commented 2 years ago

I see what you did to those commit IDs 😂

dbrgn commented 2 years ago

Merged in f7da0b028d571b5232590d303783ad90d84ac373