r-lib / hugodown

Make websites with hugo and RMarkdown
https://hugodown.r-lib.org
Other
166 stars 24 forks source link

Hugo executable not successfully located on macOS #98

Closed lorenzwalthert closed 3 years ago

lorenzwalthert commented 3 years ago

With latest master(97ea0cdd63152a58987ae9e2639bcc4db4e5a83a), I get

> hugodown::hugo_start()
Starting server on port 1313
Error: hugo 0.59.1 not installed
ℹ Do you need to call `hugodown::hugo_install('0.59.1')`?
Run `rlang::last_error()` to see where the error occurred.
> hugodown::hugo_install('0.59.1')
Finding release
hugo 0.59.1 already installed
> hugodown::hugo_start()
Starting server on port 1313
Error: hugo 0.59.1 not installed
ℹ Do you need to call `hugodown::hugo_install('0.59.1')`?
Run `rlang::last_error()` to see where the error occurred.

Turns out that the directory structure on macOS is

~/Library/Caches/hugodown/hugo_extended_0.59.1_macOS_64bit/hugo

So in hugo_locate(), we should probably check if the directory ~/Library/Caches/hugodown/hugo_extended_0.59.1_macOS_64bit exists, not the file.

lorenzwalthert commented 3 years ago

Oh, this is actually caused by the dev version of {fs} failing to do path expansion. https://github.com/r-lib/fs/issues/325. Assume this problem will be fixed there.