Skip to content

Commit 520b97c

Browse files
authored
as_job = auto now does not prevent rendering in positron context (#246)
1 parent 8b2a3ba commit 520b97c

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: quarto
22
Title: R Interface to 'Quarto' Markdown Publishing System
3-
Version: 1.4.4.9008
3+
Version: 1.4.4.9009
44
Authors@R: c(
55
person("JJ", "Allaire", , "jj@posit.co", role = "aut",
66
comment = c(ORCID = "0000-0003-0174-9868")),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# quarto (development version)
22

3+
- `quarto_render()` now correctly set `as_job` when not inside RStudio IDE and required **rstudioapi** functions are not available (#203).
4+
35
- Add several new wrapper function (thanks, @parmsam, #192):
46
- `quarto_list_extensions()` to list installed extensions using `quarto list extensions`
57
- `quarto_remove_extension()` to remove an installed extension using `quarto remove extensions`

R/render.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ quarto_render <- function(
106106
}
107107

108108
# render as job if requested and running within rstudio
109-
if (as_job && rstudioapi::isAvailable()) {
109+
if (
110+
as_job &&
111+
rstudioapi::isAvailable() &&
112+
rstudioapi::hasFun("jobRunScript") &&
113+
in_rstudio()
114+
) {
110115
message(
111116
"Rendering project as background job (use as_job = FALSE to override)"
112117
)

R/utils.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ merge_list <- function(x, y) {
2525
`%||%` <- function(x, y) {
2626
if (is_null(x)) y else x
2727
}
28+
29+
in_positron <- function() {
30+
identical(Sys.getenv("POSITRON"), "1")
31+
}
32+
33+
in_rstudio <- function() {
34+
identical(Sys.getenv("RSTUDIO"), "1")
35+
}

0 commit comments

Comments
 (0)