Skip to content

Commit

Permalink
Add quarto::quarto_create_project
Browse files Browse the repository at this point in the history
  • Loading branch information
focardozom committed Aug 15, 2024
1 parent 792cdd0 commit 68d9aa5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Suggests:
knitr,
magick,
pkgload (>= 1.3.2.1),
quarto,
rmarkdown,
roxygen2 (>= 7.1.2),
spelling (>= 1.2),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(create_from_github)
export(create_github_token)
export(create_package)
export(create_project)
export(create_quarto_project)
export(create_tidy_package)
export(edit_file)
export(edit_git_config)
Expand Down
18 changes: 17 additions & 1 deletion R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' * `create_package()` creates an R package
#' * `create_project()` creates a non-package project, i.e. a data analysis
#' project
#' * `create_quarto_project()` creates a Quarto project
#'
#' Both functions can be called on an existing project; you will be asked before
#' any existing files are changed.
Expand All @@ -28,7 +29,8 @@
#' * If using RStudio desktop, the package is opened in a new session.
#' * If on RStudio server, the current RStudio project is activated.
#' * Otherwise, the working directory and active project is changed.
#'
#' @param ... pass quarto_create_project aditional arguments.
#' @param name name for quarto project folder
#' @return Path to the newly created project or package, invisibly.
#' @seealso [create_tidy_package()] is a convenience function that extends
#' `create_package()` by immediately applying as many of the tidyverse
Expand Down Expand Up @@ -109,6 +111,18 @@ create_project <- function(path,
invisible(proj_get())
}



#' @rdname create_package
#' @export
create_quarto_project <- function(name, ...) {

rlang::check_installed("quarto", reason = "to use `quarto_create_project()`")

Check warning on line 120 in R/create.R

View check run for this annotation

Codecov / codecov/patch

R/create.R#L120

Added line #L120 was not covered by tests

quarto::quarto_create_project(name = name, ...)

Check warning on line 122 in R/create.R

View check run for this annotation

Codecov / codecov/patch

R/create.R#L122

Added line #L122 was not covered by tests

}

#' Create a project from a GitHub repo
#'
#' @description
Expand Down Expand Up @@ -380,3 +394,5 @@ challenge_home_directory <- function(path) {
}
invisible()
}


8 changes: 8 additions & 0 deletions man/create_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68d9aa5

Please sign in to comment.