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

Stop create_charpente() when license is not provided #24

Open
hypebright opened this issue Jan 21, 2024 · 1 comment
Open

Stop create_charpente() when license is not provided #24

hypebright opened this issue Jan 21, 2024 · 1 comment

Comments

@hypebright
Copy link
Contributor

Would be nice if there's a first check to see if the license argument is provided in create_charpente(), otherwise you end up with a half-complete package.

Simple fix:

  if(missing(license)) {
    ui_stop('Please provide a license, e.g. "mit" or "gpl3"')
  }

also update example in roxygen documentation 📝

@DivadNojnarg
Copy link
Member

Yes a check could be nice.

Do you think this could default to "mit"? Also this line is quite bad code:

  eval(parse(text = paste0("use_", license, "_license()")))

Instead:

create_charpente <- function(license) {
 eval(substitute(license))
}

so people can pass instead of a string: create_charpente(usethis::use_mit_license())

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