psibi / tldr-hs

Haskell tldr client
BSD 3-Clause "New" or "Revised" License
92 stars 14 forks source link

Use the official pages mirror and not the github repository for caching pages #32

Closed gutjuri closed 3 years ago

gutjuri commented 3 years ago

closes #31

git is no longer a dependency.

Performance is not affected. The initialisation of the cache is much faster now. Even though updating the cache is no longer incremental, it is hardly slower.

psibi commented 3 years ago

That was quick. Thanks! I'm liking this so far. I will review the MR once the CI passes.

psibi commented 3 years ago

I'm not seeing anywhere where the --update workflow is handled ? Is that intended ?

gutjuri commented 3 years ago

What exactly are you referring to? Starting the programme with --update invokes the code I have provided, if that's what you mean.

psibi commented 3 years ago

@gutjuri Ah, I see what you mean. Thanks! I tested your MR locally, and in it's initial use it outputs this:

$ tldr ls
No tldr entry for ls

Probably check whether the directory is initialized and if not try downloading and populating the cache ?

Also, there seems to be a speed difference of 3 second between the git version and the zip version of tldr --update. But that seems fine, I guess. Not having dependency on git is nice!

gutjuri commented 3 years ago

@gutjuri Ah, I see what you mean. Thanks! I tested your MR locally, and in it's initial use it outputs this:

$ tldr ls
No tldr entry for ls

Probably check whether the directory is initialized and if not try downloading and populating the cache ?

Done. I also added an auto-update feature that updates the cache when it is older than 7 days.

Also, there seems to be a speed difference of 3 second between the git version and the zip version of tldr --update. But that seems fine, I guess. Not having dependency on git is nice!

Is the zip version the slower one? This isn't the case for me. I'm based in Europe, maybe tldr.sh is faster in Europe and github.com is faster in your region (if you're not based in Europe). Accessing both tldr.sh and github.com routes me to north american servers.

psibi commented 3 years ago

I also added an auto-update feature that updates the cache when it is older than 7 days.

Thanks, but I would prefer not have auto-update by default. I'm not opposed to introducing a configuration file where we can control this behavior.

Is the zip version the slower one?

Yeah. I guess it would also depend on other factors like which commit of git I'm in and so on.

gutjuri commented 3 years ago

I also added an auto-update feature that updates the cache when it is older than 7 days.

Thanks, but I would prefer not have auto-update by default. I'm not opposed to introducing a configuration file where we can control this behavior.

I see. I personally don't really like configuration files. I accommodated your wish by making the auto-update optional. Users now have to specify the command line option --auto-update-interval DAYS if they wish to enable this functionality. For convenience I also added an explanation on how to set an alias in the command line configuration to have this feature without having to type out the option each time.

psibi commented 3 years ago

@gutjuri Should I go ahead and finish this MR ?

gutjuri commented 3 years ago

@gutjuri Should I go ahead and finish this MR ?

psibi commented 3 years ago

@gutjuri Thanks, I have released a new version with your changes.