dbrgn / tealdeer

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

Cache not found but update successful #371

Closed mat-m closed 1 month ago

mat-m commented 1 month ago

on RedHat 8, with tldr 1.4.1

The cache is updated and filled (41M), but the command do not find it.

Technical info below

~/[0]>tldr ls
Cache not found. Please run `tldr --update`.
~/[1]>tldr --update
Successfully updated cache.
~/[0]>echo $?
0
~/[0]>ls -ln /home/env/adlbin/.cache/tealdeer/tldr-main/ | tail -2
-rw-rw-r--  1 994 932    45 Jul 11 19:49 requirements.txt
drwxrwxr-x  3 994 932  4096 Jul 12 17:30 scripts
~/[0]>tldr ls
Cache not found. Please run `tldr --update`.
~/[1]>tldr -v
tealdeer v1.4.1 (Linux)
~/[0]>file $(which tldr)
/usr/local/bin/tldr: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
niklasmohrin commented 1 month ago

The problem is that when v1.4.1 was released (September 2020!), the pages repository still used "master" as the main branch name and we thus expect the folder to be called tldr-master (see here in the code). However, when downloading from https://github.com/tldr-pages/tldr/archive/master.tar.gz , we get a file named tldr-main.zip (and also containing the folder tldr-main, as seen in your output).

As a workaround, you can rename the folder under .cache/tealeer so that it is called tldr-master instead. The best solution however would be to update to a newer version - nowadays, the pages come through an archive from tldr.sh that should be more stable than the direct github download.

mat-m commented 1 month ago

Since I can't control the version installed, I symlinked tldr-master to tldr-main.

Thank you for the explanation, that helped