Skip to content

Commit 4319c8b

Browse files
authored
Account for the absence of Quarto CLI (#2164)
* Account for the absence of Quarto CLI * Apparently quarto_available() appeared in v1.5.0 I don't think minimum version is truly supported/enforced for a suggested package, so I don't expect this to be a definitive fix. But I think this might be as far as I can/should go here in usethis. Morally, it's the right solution. This should be sufficient once the quarto package itself is being built for all CRAN flavors.
1 parent 2edeaac commit 4319c8b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Suggests:
5050
knitr,
5151
magick,
5252
pkgload (>= 1.3.2.1),
53-
quarto,
53+
quarto (>= 1.5.0),
5454
rmarkdown,
5555
roxygen2 (>= 7.1.2),
5656
spelling (>= 1.2),

R/create.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ create_quarto_project <- function(
136136
) {
137137
check_installed("quarto")
138138

139+
if (!quarto::quarto_available(error = FALSE)) {
140+
ui_abort(c(
141+
"x" = "The Quarto CLI must be available to create a Quarto project.",
142+
"i" = "See {.url https://quarto.org/docs/get-started/}."
143+
))
144+
}
145+
139146
path <- user_path_prep(path)
140147
parent_dir <- path_dir(path)
141148
check_path_is_directory(parent_dir)

tests/testthat/test-create.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ test_that("we discourage project creation in home directory", {
151151

152152
test_that("create_quarto_project() works for basic usage", {
153153
skip_if_not_installed("quarto")
154+
skip_if_not(quarto::quarto_available(error = FALSE))
154155

155156
dir <- create_local_quarto_project()
156157
expect_proj_file("_quarto.yml")

0 commit comments

Comments
 (0)