r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
714 stars 334 forks source link

Invalid "use pkgdown::clean_site()" advice #2699

Open Bisaloo opened 3 months ago

Bisaloo commented 3 months ago

When docs/ is not empty and not created by pkgdown, an error message will be returned:

https://github.com/r-lib/pkgdown/blob/c7c4865d9ebd492010c99db13a3e377cd1d9ed34/R/clean.R#L30-L41

But when running pkgdown::clean_site(), the same message is returned because clean_site() itself calls check_dest_is_pkgdown():

https://github.com/r-lib/pkgdown/blob/c7c4865d9ebd492010c99db13a3e377cd1d9ed34/R/clean.R#L19-L21

I can create a reprex package for this issue if helpful.

hadley commented 3 months ago

Hmmm, I think it's the advice that's wrong here — clean_site() is specifically for cleaning up sites (as the name suggests 😄) not deleting directories that aren't sites.