Skip to content

Commit

Permalink
Add attribute to repos, for renv users (#502)
Browse files Browse the repository at this point in the history
* Add attribute to `repos`, for renv users

* Fix doubled up `options()`

* Only attribute if we detect `@CRAN@`, use "IDE" for attribute
  • Loading branch information
juliasilge authored Sep 4, 2024
1 parent 56df00f commit 8c004a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/ark/src/modules/positron/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,19 @@ options(device = function() {
# Set cran mirror
repos <- getOption("repos")
rstudio_cran <- "https://cran.rstudio.com/"

if (is.null(repos) || !is.character(repos)) {
options(repos = c(CRAN = rstudio_cran))
repos <- c(CRAN = rstudio_cran)
} else {
if ("CRAN" %in% names(repos)) {
if (identical(repos[["CRAN"]], "@CRAN@")) {
repos[["CRAN"]] <- rstudio_cran
options(repos = repos)
attr(repos, "IDE") <- TRUE
}
} else {
repos <- c(CRAN = rstudio_cran, repos)
options(repos = repos)
}
}
options(repos = repos)

# Show Plumber apps in the viewer
options(plumber.docs.callback = function(url) {
Expand Down

0 comments on commit 8c004a1

Please sign in to comment.