Closed
Description
My system: ubuntu 20.04
My tldr version: latest.
In the code:
Lines 194 to 204 in daf1ebf
the tldr client will always try to find the command in linux platform first. So if a command is common (like, ls
, zip
), the tldr
command will first try to find cache file only in <cache_dir>/linux/ls.md
and since the ls.md
is in the <cache_dir>/common/ls.md
, not in the <cache_dir>/linux/ls.md
, the cache failed.
Then, the client will try to get <remote_url>/linux/ls.md
from remote server. and the remote server return 404.
After that, the client will use the platform common
and the cache is found.
I suggest change code like this:
for platform in platforms: # find cache first
try:
load_page_from_cache(command, platform, languate)
except Exception:
continue
for platform in platforms: # if failed , get it from server
try:
load_page_from_server(command, platform, languate)
except Exception:
continue
Metadata
Metadata
Assignees
Labels
No labels