Skip to content

Commit f4be4e4

Browse files
authored
Minimal updates to dev_sitrep() (#2644)
Fixes #2618
1 parent f614e24 commit f4be4e4

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

NEWS.md

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

3+
34
* `build_manual()` reports more details on failure (#2586).
45
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
6+
* `dev_sitrep()` now works correctly in Positron (#2618).
57
* `is_loading()` is now re-exported from pkgload (#2556).
68
* `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).
79
* `show_news()` now looks for NEWS files in the same locations as `utils::news()`: `inst/NEWS.Rd`, `NEWS.md`, `NEWS`, and `inst/NEWS` (@arcresu, #2499).

R/sitrep.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ dev_sitrep <- function(pkg = ".", debug = FALSE) {
118118
remotes::dev_package_deps(pkg$path, dependencies = TRUE)
119119
},
120120
rstudio_version = if (is_rstudio_running()) rstudioapi::getVersion(),
121-
rstudio_msg = check_for_rstudio_updates()
121+
rstudio_msg = if (!is_positron()) check_for_rstudio_updates()
122122
),
123123
class = "dev_sitrep"
124124
)
@@ -156,7 +156,7 @@ print.dev_sitrep <- function(x, ...) {
156156
}
157157

158158
if (!is.null(x$rstudio_version)) {
159-
hd_line("RStudio")
159+
hd_line(if (is_positron()) "Positron" else "RStudio")
160160
kv_line("version", x$rstudio_version)
161161

162162
if (!is.null(x$rstudio_msg)) {

R/utils.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ is_testing <- function() {
4141
identical(Sys.getenv("TESTTHAT"), "true")
4242
}
4343

44+
is_positron <- function() {
45+
Sys.getenv("POSITRON") == "1"
46+
}
47+
4448
is_rstudio_running <- function() {
4549
!is_testing() && rstudioapi::isAvailable()
4650
}

tests/testthat/test-sitrep.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
test_that("check_for_rstudio_updates", {
22
skip_if_offline()
33
skip_on_cran()
4+
withr::local_envvar(POSITRON = "")
45

56
# the IDE ends up calling this with `os = "mac"` on macOS, but we would send
67
# "darwin" in that case, so I test with "darwin"

0 commit comments

Comments
 (0)