Skip to content

Commit 8484a24

Browse files
authored
Merge branch 'main' into quarto-available
2 parents 29cba90 + 520b97c commit 8484a24

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
- Add `quarto_available()` function to check if Quarto CLI is found (thanks, @hadley, #187).
44

5+
- `quarto_render()` now correctly set `as_job` when not inside RStudio IDE and required **rstudioapi** functions are not available (#203).
6+
57
- Add several new wrapper function (thanks, @parmsam, #192):
68
- `quarto_list_extensions()` to list installed extensions using `quarto list extensions`
79
- `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)