File: helper.R

package info (click to toggle)
r-cran-devtools 2.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,328 kB
  • sloc: sh: 15; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This is a VERY trimmed down version of create_local_thing from usethis
local_package_create <- function(envir = parent.frame()) {
  dir <- withr::local_tempdir(.local_envir = envir)

  usethis::ui_silence({
    create_package(dir, rstudio = FALSE, open = FALSE, check_name = FALSE)
  })

  dir
}

local_package_copy <- function(path, env = parent.frame()) {
  temp_path <- withr::local_tempdir(.local_envir = env)

  dir_copy(path, temp_path, overwrite = TRUE)
  temp_path
}