benmarwick/rrtools

Name not inferred correctly in LICENSE when using `create_compendium`

annakrystalli opened this issue · 2 comments

Please wait for some discussion of your report before making a Pull Request.

Describe the bug
use_git_config() no longer seems to return the user.name and user.email. As such, when running create_compendium(), the name in LICENSE and license.md is not correctly populated (ie is completely missing).

To Reproduce

rrtools::create_compendium("~/Desktop/rrcompendium")

Expected behavior

Perhaps trying to infer the name from option usethis.fullname would be better and if not possible, to either pause and prompt users to enter a name interactively during initialisation or throw a warning at the end to inform users that the name is missing in the license and needs completing manually.

Thanks for spotting this, it could be that use_git_config() changed recently so it 'invisibly' returns nothing. Here's a discussion on the usethis repo: r-lib/usethis#668 and where it was documented in a vignette: https://github.com/r-lib/usethis/blob/f08ecb6480310edd0e1c9b24e1d55359056804ec/vignettes/articles/usethis-setup.Rmd#L72-L73

Seems like use_git_config() is now an unexported function in the usethis pkg, so we can update rrtools::create_compendium with usethis:::git_config_get("user.name", global = TRUE) to fix this.

0e34d5f fixes this