R/reset_site.R

Defines functions reset_site

Documented in reset_site

#' Remove all files associated with the site
#'
#' Use this if you want to rebuild your site from scratch.
#'
#' @param path the path to the site
#'
#' @export
#' @examplesIf sandpaper:::example_can_run()
#' tmp <- tempfile()
#' create_lesson(tmp, open = FALSE, rmd = FALSE)
#' build_lesson(tmp, preview = FALSE)
#' dir(file.path(tmp, "site"))
#' reset_site(tmp)
#' dir(file.path(tmp, "site"))
reset_site <- function(path = ".") {
  check_lesson(path)
  fs::dir_delete(path_site(path))
  create_site(path)
}
zkamvar/sandpaper documentation built on April 15, 2024, 5:32 p.m.