Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_hugo does not check the version when checking for already installed version #515

Closed
cderv opened this issue Nov 23, 2020 · 1 comment

Comments

@cderv
Copy link
Collaborator

cderv commented Nov 23, 2020

When you try to run a blogdown site with the wrong hugo version, you now get an error message

<error/rlang_error>
Erreur : Found 'hugo' at 'C:\Users\chris\scoop\shims\hugo.exe' but its version is 0.78.2 instead of the requested version 0.76.5. You may try blogdown::install_hugo("0.76.5").
Backtrace:
Run `rlang::last_trace()` to see the full context.

The advice is to run blogdown::install_hugo() with correct version, but without force = TRUE it won't install the asked version.

168 MiB [<no git>] > blogdown::install_hugo("0.76.5")
It seems Hugo has been installed. Use force = TRUE to reinstall or upgrade.*

So it is one more step to run

blogdown::install_hugo("0.76.5", force = TRUE)

before being able to preview the website which had a pinned hugo version.

I think we should either:

  • add force = TRUE in the error message advice
  • make install_hugo only message with 'It seems Hugo has been installed. Use force = TRUE to reinstall or upgrade.' if the version is the same as the one provided in version =

What do you think ?

@yihui yihui closed this as completed in 11e21cb Nov 25, 2020
@yihui
Copy link
Member

yihui commented Nov 25, 2020

The argument force = TRUE is no longer useful, so I just deprecated it. It was there originally only because install_hugo() may install Hugo to a place in PATH, and I wanted to avoid the unnecessary install when it could be detected in PATH. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants