diff --git a/DESCRIPTION b/DESCRIPTION index 932c128..cdff007 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,6 +37,6 @@ LazyData: true URL: https://github.com/benmarwick/rrtools BugReports: https://github.com/benmarwick/rrtools/issues Suggests: testthat, quarto, knitr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 VignetteBuilder: knitr Date: 2019-01-15 diff --git a/R/helpers_package.R b/R/helpers_package.R index 0f39114..831a7f8 100644 --- a/R/helpers_package.R +++ b/R/helpers_package.R @@ -61,12 +61,16 @@ suggests_dep <- function(pkg) { deps[found, ] } -# from https://github.com/r-lib/devtools/blob/master/R/utils.R -is_installed <- function(pkg, version = 0) { +# from https://github.com/r-lib/devtools/blob/master/R/utils.R but this +# function was removed some time ago, so I've just updated it to keep it +# working +is_installed <- function(pkg, version = "0.0.0") { installed_version <- tryCatch(utils::packageVersion(pkg), error = function(e) NA) - !is.na(installed_version) && installed_version >= version + required_version <- as.package_version(version) + !is.na(installed_version) && installed_version >= required_version } + # from https://github.com/r-lib/devtools/blob/master/R/pkgload.R check_suggested <- function(pkg, version = NULL, compare = NA) { diff --git a/R/helpers_templates.R b/R/helpers_templates.R index 2d0a805..605ff27 100644 --- a/R/helpers_templates.R +++ b/R/helpers_templates.R @@ -5,23 +5,23 @@ use_template <- function(template, save_as = template, data = list(), path <- file.path(pkg$path, out_path, save_as) if (!can_overwrite(path, ask = ask)) { - stop("`", save_as, "` already exists.", call. = FALSE) + stop(glue::glue("`{save_as}` already exists."), call. = FALSE) } template_path <- template_path_fn(template) template_out <- whisker::whisker.render(readLines(template_path), data) - usethis::ui_done("Creating {usethis::ui_value(save_as)} from template.") + usethis::ui_done(glue::glue("Creating {usethis::ui_value(save_as)} from template.")) writeLines(template_out, path) if (ignore) { - usethis::ui_done("Adding {usethis::ui_value(save_as)} to `.Rbuildignore`.") + usethis::ui_done(glue::glue("Adding {usethis::ui_value(save_as)} to `.Rbuildignore`.")) use_build_ignore(save_as, pkg = pkg) } if (open) { - usethis::ui_todo("Modify ", usethis::ui_value(save_as)) + usethis::ui_todo(glue::glue("Modify {usethis::ui_value(save_as)}")) open_in_rstudio(path) }