Skip to content

Commit 819895a

Browse files
committed
Fix example
1 parent e6eca33 commit 819895a

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

R/utils-projects.R

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,20 @@ get_running_project_root <- function() {
213213
#' @return Character Path of the project root directory if found, or `NULL`
214214
#'
215215
#' @examplesIf quarto_available()
216-
#' dir <- tempfile()
217-
#' dir.create(dir)
218-
#' find_project_root(dir)
219-
#' quarto_create_project(dir)
220-
#' find_project_root(dir)
221-
#'
222-
#' xfun::in_dir(dir,
223-
#' # Check if current directory is in a Quarto project
216+
#' tmpdir <- tempfile()
217+
#' dir.create(tmpdir)
218+
#' find_project_root(tmpdir)
219+
#' quarto_create_project("test-proj", type = "blog", dir = tmpdir, no_prompt = TRUE, quiet = TRUE)
220+
#' blog_post_dir <- file.path(tmpdir, "test-proj", "posts", "welcome")
221+
#' find_project_root(blog_post_dir)
222+
#'
223+
#' xfun::in_dir(blog_post_dir, {
224+
#' # Check if current directory is a Quarto project or in one
224225
#' !is.null(find_project_root())
225-
#' )
226+
#' })
227+
#'
226228
#' # clean up
227-
#' unlink(dir, recursive = TRUE)
229+
#' unlink(tmpdir, recursive = TRUE)
228230
#'
229231
#'
230232
#' @seealso [get_running_project_root()] for detecting active Quarto rendering

man/find_project_root.Rd

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)