diff --git a/NEWS.md b/NEWS.md index 4f15aa4da..11f0a66e1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,9 @@ # devtools (development version) + * `build_manual()` reports more details on failure (#2586). * New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507) +* `dev_sitrep()` now works correctly in Positron (#2618). * `is_loading()` is now re-exported from pkgload (#2556). * `load_all()` now errors if called recursively, i.e. if you accidentally include a `load_all()` call in one of your R source files (#2617). diff --git a/R/sitrep.R b/R/sitrep.R index f8a7be0d5..d21dcef61 100644 --- a/R/sitrep.R +++ b/R/sitrep.R @@ -118,7 +118,7 @@ dev_sitrep <- function(pkg = ".", debug = FALSE) { remotes::dev_package_deps(pkg$path, dependencies = TRUE) }, rstudio_version = if (is_rstudio_running()) rstudioapi::getVersion(), - rstudio_msg = check_for_rstudio_updates() + rstudio_msg = if (!is_positron()) check_for_rstudio_updates() ), class = "dev_sitrep" ) @@ -156,7 +156,7 @@ print.dev_sitrep <- function(x, ...) { } if (!is.null(x$rstudio_version)) { - hd_line("RStudio") + hd_line(if (is_positron()) "Positron" else "RStudio") kv_line("version", x$rstudio_version) if (!is.null(x$rstudio_msg)) { diff --git a/R/utils.R b/R/utils.R index 105a2c7d1..ae3b3451a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -41,6 +41,10 @@ is_testing <- function() { identical(Sys.getenv("TESTTHAT"), "true") } +is_positron <- function() { + Sys.getenv("POSITRON") == "1" +} + is_rstudio_running <- function() { !is_testing() && rstudioapi::isAvailable() } diff --git a/tests/testthat/test-sitrep.R b/tests/testthat/test-sitrep.R index ba5bf106e..3a11128cd 100644 --- a/tests/testthat/test-sitrep.R +++ b/tests/testthat/test-sitrep.R @@ -1,6 +1,7 @@ test_that("check_for_rstudio_updates", { skip_if_offline() skip_on_cran() + withr::local_envvar(POSITRON = "") # the IDE ends up calling this with `os = "mac"` on macOS, but we would send # "darwin" in that case, so I test with "darwin"