From 8c0bd8d493ca25cb9341bb70c86124517f0e1c16 Mon Sep 17 00:00:00 2001 From: William Boman Date: Fri, 22 Dec 2023 14:05:25 +0100 Subject: [PATCH] fix: conditionally set CRAN repo (#3) Also change the default repo URL to https://cloud.r-project.org. Fixes #2. --- src/install.r | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/install.r b/src/install.r index 32d8492..4a29ead 100644 --- a/src/install.r +++ b/src/install.r @@ -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