Skip to content

Commit

Permalink
fix: conditionally set CRAN repo (#3)
Browse files Browse the repository at this point in the history
Also change the default repo URL to https://cloud.r-project.org.

Fixes #2.
  • Loading branch information
williamboman authored Dec 22, 2023
1 parent 45b5f17 commit 8c0bd8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/install.r
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ ref <- args[2]

options(langserver_library = langserver_library)
options(langserver_quiet = FALSE)
options(repos = list(CRAN = "http://cran.rstudio.com/"))
local({
current_cran <- getOption("repos")["CRAN"]
if (current_cran == "@CRAN@")
options(repos = c(CRAN = "https://cloud.r-project.org"))
})
rls_lib <- getOption("langserver_library")
.libPaths(new = rls_lib)
did_install_remotes <- FALSE
Expand Down

1 comment on commit 8c0bd8d

@gwd666
Copy link

@gwd666 gwd666 commented on 8c0bd8d Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamboman : fyi just tested it - and works as expected

Please sign in to comment.