cderv / pandoc

R package to install, manage and run Pandoc (https://pandoc.org/)
https://cderv.github.io/pandoc/
Other
27 stars 2 forks source link

Does `pandoc_install()` need to fetch releases before checking if version is installed? #16

Closed gadenbuie closed 2 years ago

gadenbuie commented 2 years ago

In a fresh session, calling pandoc_install() for a specific installed version will fetch pandoc releases from GitHub, which is slow. Subsequent calls to pandoc_install() are fast. Is it possible to check if the requested version is installed before fetching releases so that pandoc_instal() is always fast if the version is already installed?

# new session, first call is slow...
pandoc::pandoc_install("2.13")
#> ℹ Fetching Pandoc releases info from github...
#> ✓ Pandoc 2.13 already installed.
#>   Use 'force = TRUE' to overwrite.

# next call is fast
pandoc::pandoc_install("2.13")
#> ✓ Pandoc 2.13 already installed.
#>   Use 'force = TRUE' to overwrite.
cderv commented 2 years ago

Oh yes that is a good idea. I have thought of the cache for subsequent call but not in that case of already install. I'll see to change the order. thanks!

cderv commented 2 years ago

It should now work. We only need to resolve version = "latest" fetching GH information before being able to check if latest available version is installed. However, for specific version it should be ok now.