kuanyui / tldr.el

tldr client for Emacs
142 stars 16 forks source link

tldr-update-docs leads to infinite loop on windows #42

Closed doxus closed 1 year ago

doxus commented 1 year ago

Quite similar to #27.

After calling the tldr-update-docs in any way, I get stuck in downloading sources over and over again. Excerpt from messages:

This is the first time you have run TLDR. Please wait while the latest TLDR docs are downloaded... Contacting host: github.com:443 Wrote c:/Users/redacted/Local/Temp/tldr-source.zip The TLDR docs are up to date! This is the first time you have run TLDR. Please wait while the latest TLDR docs are downloaded... Contacting host: github.com:443 Wrote c:/Users/redacted/Local/Temp/tldr-source.zip The TLDR docs are up to date! This is the first time you have run TLDR. Please wait while the latest TLDR docs are downloaded... Contacting host: github.com:443 Wrote c:/Users/redacted/AppData/Local/Temp/tldr-source.zip The TLDR docs are up to date!

Some poking around leads me to believe that the issue is caused by this line: (shell-command-to-string (format "mv '%s' '%s'" (concat (file-truename user-emacs-directory) "tldr-main") tldr-directory-path)

On windows by default there is no mv command - there's move instead. Probably the easiest solution is to check system-type and use appropriate move command.

If you guys don't have time I can try and PR this sometime next week (doesn't sound too difficult since you guys already check that, but that'd be my first time writing some actual elisp so watch out : ^))